Three major methods of storing files of data in secondary storage
File Organization: Three Methods
There are three majormethods of storing file of data in secondary storage :
- Sequantial file organization, in whic records are organized in a particular order
- Direct file organization, in which records are not organized in any special order
- Indexed file organization, in which records are organized sequentially, but indexs built into the file allow a record to be accessed either sequentially or directly.
Sequential File Organization
Sequential file processing means records are in order according to a key field. As noted earlier, a people file will be in order by a key that uniquely identifies each person, such as social security number or customer number If a particular records in the file must be read before reaching the desired record. Tape storage is limited to sequential file organization. Disk storage may be sequential, but records on disk can also be accessed directly.
Direct File Organization
direct access |
Obviiously, if we have a completely blank area on the disk and can put records anywhere, then there must be some predictable system for placing a recors at a disk address and then retrieving the record at a subsequent time. In other word, once the record has been placed on a disk, it must be possible to find it again. This is done by choosing a certain formula to apply to the record key, thereby deriving a number to use as the disk address. Hashing, or randomizing, is the name given to the process of applying a mathematical operation to a key to yield a number that represents the addres. Even though the record keys are unique, it is possible for a hashing scheme to produce the same disk addres, called a synonym, for two different records; such an accurrence is called a collision. There are various ways to recover from a collison; one way is simply to use the next available record slot on the disk.
Indexed File Organization
Indexed file processing, or indexed processing, is a third method of file organization, and it represents a compromise between the sequential and direct methods. It is useful in applications where a file needs to be in sequential order but, in addition, access to individual records is needed.
An indexed file work as follows: Record are stored in the file in direct sequential order, but in the file also contains an index. The index contains entries consisting of the key to each record stored on the file and the corresponding disk address for that record. The index is like a directory, with the keys to all records listed in order. To access a record directly, the record key must be located in the index: the address associated with the key is then used to locate the record on the disk. To access the entire file of records sequentially, begin with the first record and proceed through the rest of the records.
Before we proceed with the actual processing of data, we need to pause briefly to consider the physical activity of the disk as it access records directly.
Disk Access to Data
Three primary factors determine access time, the time needed to access data directly on disk :
- Seek time, This is the time it takes the access arm to get into position over a particular track. Keep in mind that all the access arms move as a unit, so they are simultaneously in position over a set f tracks that comprise a cylinder.
- Head Switching, The access arms on the access mechanism do not move separately; they move together, all at the same time. However, only one read/write head over a particular track on a particular surface. Since head swiching takes place at the speed of electricity; the time it takes is negligible.
- otational delay. Once the access arm and read/write head is in position, ready to read or write data, the read/write head waits for a short period until the desired data on the track moves under it.
Once the data has been found, we must consider data transfer, the process of transferring data between memory and the place on the disk track-from memory to the track if you are writing, from the track to memory if you are reading.
One measure for the performance of disk drives is the average access time, which is usually measured in millisecond (ms). Another measure is the data transfer rate, which tells how fast data can be transferred once it has been found. This usually will be stated in terms of megabytes of data per second.
Thanks for sharing us. Meridian Norstar
ReplyDelete