0% found this document useful (0 votes)
648 views2 pages

Flat-File Vs Relational

A flat-file database consists of a single table, while a relational database comprises multiple tables linked by relationships. Flat-file databases can result in data redundancy where the same information is duplicated across records, potentially leading to data inconsistencies if one record is updated differently than others. Relational databases avoid redundancy and inconsistencies by storing each unique piece of information only once. Other disadvantages of flat-file databases include slower data entry due to duplication, greater disk usage, and lack of access controls compared to relational databases which allow different user permissions and views of the data.

Uploaded by

ddlalu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
648 views2 pages

Flat-File Vs Relational

A flat-file database consists of a single table, while a relational database comprises multiple tables linked by relationships. Flat-file databases can result in data redundancy where the same information is duplicated across records, potentially leading to data inconsistencies if one record is updated differently than others. Relational databases avoid redundancy and inconsistencies by storing each unique piece of information only once. Other disadvantages of flat-file databases include slower data entry due to duplication, greater disk usage, and lack of access controls compared to relational databases which allow different user permissions and views of the data.

Uploaded by

ddlalu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Flat-File Databases versus Relational Databases:

More than you will ever need to know

A flat-file database consists of one table. A relational database


comprises a number of tables that are linked by foreign-key relationships.
In a flat-file database the same piece of information may be repeated
lots of times, for instance a flat-file database showing product sales may
show a product and its price each time a product is sold. That a product has
a particular price is really just one piece of information and a relational
database would only store it once, in a separate product table. The fact
that a flat-file database stores this information once for every time the
product is sold is an example of data redundancy. Data redundancy can
cause problems in a database system, for instance if a product's name
changes. In a flat-file database this change has to be made many times, but
in a relational database it only needs to be changed once.
Data redundancy can also lead to data inconsistency, for example if a
new row is created and the product's price is entered wrongly. In this case
some rows will give the product's price as one value and other rows will
have a different value. Relational databases avoid data consistency
problems by only storing each piece of information once. It is still possible
to enter a "wrong" price for a product, but it is impossible for the price to
be inconsistent if the database is designed properly.
Other problems associated with data redundancy are firstly the extra
time it takes for data entry (it takes time to write things out again and
again) and secondly the extra disk space that this requires.
Often a flat-file database will just be a CSV (comma-separated
values) file. In this case it is impossible to assign different levels of access
to different users. Even if the flat-file database is stored in a DBMS
(database management system) it is not possible to implement the tablelevel access that relational databases allow.
A final, and rather complex disadvantage of flat-file databases is that
the user interface is dependent on the file structure. That means that if you
want to create a different view of the data, just some of the fields say, then
you have to create a new file. This is known as program-data dependence.
In a relational database the file structure is totally unrelated to the table
structure so it is possible to create all sorts of different views of the data to
suit different users.
Flat-file databases do have their advantages. Firstly, if the
information is printed out it is much easier to read for a human than would
be a set of relational tables.
Secondly, because flat-file database software does not need to do lots
of CPU-intensive look-ups to join a number of tables, queries can run much
faster than in relational databases. The process of splitting information into
separate tables so that there is absolutely no redundancy is called
"normalisation". In practice it is very rare for a relational database to be
fully normalised because of the effect this has on performance.

Advantages
Flat-file database

1.

Fast data
retrieval
2.
Easier for a
human to read

Disadvantages
1.
2.
3.
4.
5.
6.
7.

Relational database

1.

Less data
redundancy
2.
Less data
inconsistency
3.
Better security
4.
Program-data
independence

1.
2.

Duplicated data
Slower data
entry
More disk space
required
Data
inconsistency is
possible
Updates have to
be done multiple
times
Little or no
access control
Program-data
dependence
Slower data
retrieval
Difficult to read
original table data

You might also like