RelationalDBDesign
RedhatLinuxSys Seomining
prev next prev next
Course navigation
Lesson 2 Relational vs. flat file databases
Objective Understand the difference between relational and flat file databases.
Prior to using SQL, typical systems used a flat file approach.
A flat file is a computer file that can only be read or written sequentially. It consists of one or more records.
Each record contains one or more field instances. Each field instance can contain a data value, or be omitted.
Some definitions state that all records must be of the same type. This restriction is usual when discussing a flat file database.
However, most usages allow a flat file to have more than one record type.
Flat files date back to the earliest days of computer processing. Originally flat files were stored on punch cards, paper tape, or magnetic tape.
These are inherently sequential. Flat files are still widely used, even for files stored on a disk. One reason is that sequential access is faster
than indexed access, (also known as random access or direct access). Flat files are often used to transmit data between batch processing systems, especially on mainframes.
Flat File Database
A flat file database contains information that, as often as possible, is stored in the order in which it is needed.
The approach of a flat file database is contrary to the approach of a relational database, in which how information is stored does not matter; how it is retrieved does.
Flat files use techniques such as keeping track of pointers from one set of information to another. These pointers, called linked lists in many approaches, are difficult for the developer to maintain. Any time someone adds information to the database, the pointers have to be updated to show the next piece of information and the previous set of information. The management of these pointer updates has been a thorn in the side of database developers.
Relational databases do not use flat file approaches. Instead, relational databases focus on storing information efficiently for the operating system and database package. This is separate from the emphasis on providing a means for easy information retrieval from the system.
Relational database
A relational database contains data that is stored in tables.
Data can be accessed or organized in different ways without the need to make accompanying changes to the tables.
Course navigation