Organizing and Accessing Stored Data:
As users of computer systems, we jut offer data as we are instructed to do, such as punching in our identification code at an automated teller machine or perhaps filling out a form with our name and address. But data cannot be dumped unsystematically into a computer. Some computer professional probably a programmer or systems analyst head to plan how data from users will be received, organized, and stored, and also in what manner data will be processed by the computer. First consider how data is organized for processing.
Data Organization:
To be processed by the computer, raw data is organized into characters, fields, records, files, and databases, we will start with the smallest element, the character.
-
Character
The basic building block of data is character, which consist of letters (A, B, C,....Z), numeric digits (0, 1, 2, ....9) or special character (+, -, /, @, #). These characters are put together to form a field (also called data item or data element).
-
Field
A field is a meaningful collection of related characters. It is smallest logical entity that is treated as a single unit in data processing. For example, suppose we are processing students data of a college we may have roll no field, student name field, father's name field, address, etc.
-
Record
A record is a collection of related fields. Thus, in the college, the students roll no., name, father name, address, phone number constitute record.
-
File
A file (sometimes called table) is a collection of related records. All students of a college compose a file.
-
Database
A database is a collection of interrelated files stored together with minimum redundancy. In addition to organizing the expected data, a plan must be made to access the data on files.
File Organization:
Now that we have a general idea of how data is organized, we need to consider what way would be appropriate to place data on a storage medium, tape or disk.
The selection of a particular file organization depends upon the type of application. The best file organization to use in a given application is the one that happens to meet the users needs in most effective and economical manners. Every files organization requires the use of some key field or unique identifying value that it found in every record in the file. The key value must be unique for each record of the file because duplications would cause serious problems. In the payroll example, the employee code field may be used as the key field. consider this chain:
-
It is the application area-payroll, airline reservations, inventory control, what ever that determines the way the data must be accessed by users.
-
Once an access method has been determined, then it follows that there are certain ways the data must be organized so that the needed access is workable.
-
The organization method, in turn, limits, what storage medium may be used.
Methods of File Organizations:
a. Sequential File Processing:
b. Direct File Processing:
C. Index File Processing:
a. Sequential File Processing:
In
sequential file, records are stored one after another in an ascending or descending order determined by the key field of the records. In pay role example, the records of the employee file may be organized sequentially by employee code sequence. to access these records, the computer must read the file in sequence from the beginning. The first record is read and processed first, then the second record in the file sequence, and so on. To locate a particular record, the computer must read each record in sequence and compare its key field to the one that is needed.
|
Sequential File Processing |
| Advantages |
Disadvantages |
- Relatively inexpensive I/O media & devices can be used for the storage and processing of such files.
- It is most efficient and economical file organization in case of applications in which there are a large number of file records to be updated infrequently
|
- It proves to be very inefficient and uneconomical for applications in which the processing ratio is very high.
- Transaction must be stored and placed in sequence prior to processing.
- Data redundancy is typically high since the same data may be stored in several files sequenced on different keys.
|
b. Direct File Processing:
A
direct file
also called a
random file
consists of records organized in such a way that it is possible for the computer to directly locate the key of the desired record without heaving to search through a sequence of other records. This means that the time required for online inquiry and updating a few records is much faster than when sequential techniques are used. Direct processing requires disk storage; infect, a disk device is called a direct access storage device (DASD) because the computer can go directly to the desired records on the disk. A record is stored in a direct file by its key filed directly use the storage location numbers in direct access storage devices (DASD).
Direct file processing , or direct access, allows the computer to go directly to the desired record by using a record key; the computer does not have to read all preceding records in the file as it does if the records are arranged sequentially. Direct processing requires disk storage; in fact a disk device is called a direct-access storage device (DASD) because the computer can go directly to the desired record on the disk.
It is DASD ability to access any given record instantly that has made computer systems so convenient for people in service industries for example, Bank tellers checking individual bank balances. An added benefit of direct access organization is the ability to read, change, and returns a records to its same place on the disk; this is called updating in place.
|
Direct Files Processing |
| Advantages |
Disadvantages |
- The access to, and retrieval of record is quick and direct. Any record can be located and retrieved directly in a friction of second without the need for a sequential search of the file.
- Transaction need not to be stored and placed in sequence prior to processing.
- It is possible to process direct file records sequentially in a record key sequence.
- A direct file organization is most suitable for interactive online application such as airline or railway reservation system, teller facility in banking application, etc.
|
- These files must be stored on direct access storage devices. Hence, relatively expansive hardware and software resource are required.
- special security measures are necessary for online direct files that are accessible from several stations.
|
c. Index Files Processing:
Indexed file processing , or indexed processing, is a third method of file organization and it represents a compromise between the sequential and direct methods. Search in a long sequential file can be very time consuming leading to unnecessary delays in the location of the records. The search can be made faster if an index to the file is provided. Such file organization is called index sequential file. An indexed file works as follows:
-
Records are stored in the file in sequential order, but the file also contains an index to speed up access to the record without requiring a search of entire file.
-
The index contains entries consisting of the key to each records 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.
-
The record of the file can be stored in random sequence but the index table is in stored sequence on the key value. This provides the user with a very powerful tool. Not only can the file be processed randomly, but it can also be processed sequentially.
-
To access a record directly, the record key must be located in the index; the address associated with the key is then used to located the record on the disk. to access the entire file of records sequentially, begin with the first record and proceed through the records.
|