File Organization PDF
Document Details
Uploaded by RelaxedHolmium
SEGi University College
TSLee
Tags
Summary
These lecture notes cover file organization and storage, including definitions, characteristics, and types of computer files and storage.
Full Transcript
RMATIO N TEC HNOLOGY FO IN FIS0094 File Organization & Storage TSLee 1 Objectives Definition of a file and its operations Good file structure characteristics Elements of a computer file Type of computer files Types of f...
RMATIO N TEC HNOLOGY FO IN FIS0094 File Organization & Storage TSLee 1 Objectives Definition of a file and its operations Good file structure characteristics Elements of a computer file Type of computer files Types of file storages TSLee 2 What a File is? A collection of data placed under permanent or non-volatile storage A collection of data stored in one unit, identified by a filename. It can be a document, picture, audio or video stream, application, or other collection of data. Examples: anything that you can store in a disk, hard drive, tape, optical media, and any other medium which does not lose the information when the power is turned off TSLee 3 Basic File Operations Opening a File - basically, links a logical file to a physical file. Closing a File - cuts the link between physical and logical file Reading and Writing - basic I/O operations. Seeking: source file. Detecting the end of a file Detecting I/O error TSLee 4 Good File Organization Structure Characteristics Quick access to great capacity Reduce the number of disk accesses Manage growth by splitting these collections TSLee 5 Why organize? Group related information so that we are likely to get all the information we need quickly Minimize the number disk accesses to obtain the required information. Ideally, get what we need in one disk access, or get it with as little disk access as possible. TSLee 6 File organization with TAG TSLee 7 File types TSLee 8 Computer Files Classification Physical file: physically exists on secondary storage; known by the operating system; appears in its file directory Logical file: A “Channel” (like a telephone line) that hides the details of the file’s location and physical format to the program. Logical Physical File File Program 9 TSLee File Properties TSLee 10 File Properties Cluster 1 512bytes Cluster 2 512bytes Cluster 3 512bytes Cluster 4 512bytes Cluster 5 512bytes Cluster 6 512bytes.......... Cluster n 512bytes TSLee 11 Elements of computer file Records A record is a collection of related fields that Represents a single entities, e.g. in a class score sheet, detail of each student in a row such as admission number, name, total marks and position make up a record. Field A field is a single character or collection of characters that represents a single piece of data. For example, the student’s admission number is an example of a field. Characters A character is the smallest element in a computer file and refers to letter, number or symbol that can be entered, stored and output by a computer. A character is made up of seven or eight bits depending on the character coding scheme used. 12 TSLee Elements of a computer file File Record Field Field C Field Field C C C C C C C C Char Record Field…. C… Record…. Field…. C… 13 TSLee File Compression a compressed file is a sort of archive that contains one or more files that have been reduced in size. AAABBBBBCC to ? 3A5B2C TSLee 14 Compression sample “Ask not what your country can do for you -- ask what you can do for your country” (79units) 1ask 2what “1 not 2 3 4 5 6 7 8 -- 1 2 8 5 6 7 3 4” 3your (40units) 4country 5can 6do 7for 8you (37units) TSLee 15 Compression sample “Ask not what your country can do for you -- ask what you can do for your country” (79units) 1ask__ “1not__2345__--__12354” 2what__ 3you (18units) 4r__country 5__can__do__for__you (41units) TSLee 16 Compression File Type 7z Egg Alz Ice Arc Jar Cab Pak Car Rar Cfs Sqx Dar Zip Dm TSLee 17 Experiment Will compressing a compressed file further reduce the size of the file? How do I compress files in phone? TSLee 18 Part 2 File storage media and technologies TSLee 19 Task 1 Identify 8 storage media that is available currently in the room TSLee 20 Type of Storage Hard Disk Solid-State USB Flash Drive Drive Memory Optical Disc Card TSLee 21 Other Types of Storage A magnetic stripe card has a magnetic stripe that contains information A smart card stores data on an integrated circuit embedded in the card 22 TSLee Other Types of Storage The RFID tag consists of an antenna and a memory chip that contains the information to be transmitted via radio waves An RFID reader reads the radio signal and transfers the information to a computer or computing device 23 TSLee Application of RFID TSLee 24 Other Types of Storage An NFC-enabled device contains an NFC chip An NFC tag contains a chip and an antenna that contains information to be transmitted 25 TSLee Other types of Storage Network attached storage (NAS) is a server that is placed on a network with the sole purpose of providing storage to users, computers, and devices attached to the network 26 TSLee Other types of Storage Cloud storage services – dropbox, google drive, apple ? icloud, Ms OneDrive, BaiduYun. Pro & Cons – Anywhere anytime – Easy share – Backup – Rely on internet – Cost – Expose to online security 27 TSLee Enterprise Storage Enterprise hardware allows large organizations to manage and store data and information using devices intended for heavy use, maximum efficiency, and maximum availability – Redundant Array of Independent Disks(RAID) – RAID 0, 1, 5 etc 28 TSLee RAID technology Placing data on multiple disks and allowing input/output (I/O) operations to overlap in a balanced way, improving performance. Could be hardware (RAID controller) / software (Virtualization) E.g. – RAID 0, RAID 1, RAID 5, RAID 1+0 29 TSLee RAID 0 Data is split up into blocks that get written across all the drives in the array. using multiple disks (at least 2) at the same time. 30 TSLee RAID 0 Advantages offers superior I/O performance. There is no overhead caused by parity controls. All storage capacity is utilized. Disadvantages If one drive fails, all data in the RAID 0 array are lost. Ideal use for non-critical storage of data that must be read/written at a high speed, such as on an image retouching or video editing station. 31 TSLee RAID 1 Data is stored twice by writing them to both the data drive (or set of data drives) and a mirror drive (or set of drives), at least 2 drive needed. 32 TSLee RAID 1 Advantages In case a drive fails, data do not have to be rebuild, they will be copied to the replacement drive. Disadvantages the effective storage capacity is only half of the total drive capacity because all data get written twice. Ideal use for mission critical storage, for instance for accounting systems. TSLee 33 RAID 5 based on block-level striping with parity. the parity information is striped across each drive function even if one drive were to fail. 34 TSLee Parity odd number of true inputs is a true output, else false output x y z parity 1 1 0 0 0 1 1 0 0 1 0 1 1 1 1 1 TSLee 35 RAID 5 Advantages If a drive fails, still have access to all data even while the failed drive is being replaced. Disadvantages restoring the data (the rebuild time) may take a day or longer, depending on the load on the array and the speed of the controller. If another disk goes bad during the rebuild time, data are lost forever. Ideal use It is ideal for file and application servers. TSLee 36 RAID 1+0 (10) combining RAID 1 and RAID 0, often referred to as RAID 10, the data is mirrored, and the mirrors are striped. offers higher performance than RAID 1, but at a much higher cost. 37 TSLee RAID 1+0 (10) Advantages If something goes wrong with one of the disks in a RAID 10 configuration, the rebuild time is very fast since all that is needed is copying all the data from the surviving mirror to a new drive. Disadvantages Half of the storage capacity is used for mirroring, more expensive method to ensure data availability compared to large RAID 5. Ideal use Highly utilized database servers/ servers performing a lot of write operations. TSLee 38 Summary Definition of a file and its operations Good file structure characteristics Elements of a computer file Type of computer files Types of file storages TSLee 39 Reference SBCA.Introduction to File Organization. Retrieved Sept, 2018, from http://www.sbca.warduz.com/index.php?option=com_content&view=article& id=56:introtofileorg&catid=45:fileorg&Itemid=61 Samara Lynn. RAID Level Explained. PCMag. Retrieved Feb, 2019, from https://www.pcmag.com/article/255278/raid-levels-explained Muhammad Taha. Advantages and Disadvantages of RAID, 9/Aug/2018, from https://www.stalliontek.com/blog/advantages-and-disadvantages-of- raid-levels TSLee 40