flat-file database

Can someone define what a "flat-file" database is and provide an example?  I ran across the term a couple times on the web and I am trying to find out what it is and how it is different from our more traditional relational databases.
LVL 2
VEngineerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
P_S_PriceConnect With a Mentor Commented:
drrittich has missed, to my mind the essential point about traditional Flat files. Basically the data is not in 3rd Normal Form and typically a file contains more than one record type. In the early days files tended to be stored on magnetic tape much more (It was much cheaper than Disk, or The Highly expensive and now dead Drum media).

An Accounts "Database" Flat File  could have had the following Records

'A000001JOEBLOGGS00000100'
'D000001750101DR00000110INVOICE    '
'D000001750102CR00000010CREDIT NOTE'
'A000003FREDSMITH00000022'

etc etc

0
 
VEngineerAuthor Commented:
Adjusted points to 25
0
 
drittichCommented:
A flat file database is essentially one big table.  Think of a single Excel spreadsheet as an example (not a worksheet though, that can have multiple spreadsheets.)

You have multiple rows and columns, and that is about it.  The columns are the fields, and the rows are the records.  Any time you search for or sort data in a flat file database, you are going through the entire database.  Flat file databases are very quick to implement, but have bad performance and don't scale well.  They are not as flexible as relational databases, either.

A relational database is a database made up of many tables.  These tables really exist as separate entities but are joined together (related) when queried or updated so that they can appear as a whole.  This gives a flexibility and efficiency that is a bit lengthy to go into here, but it has become the industry-standard way of storing data for a reason...

Some examples of flat file databases are:  the windows registry, Novell bindery, hosts file that stores host names and ip addresses, the phone book...examples are all around you.
0
 
drittichCommented:
I intentionally skipped over that, it is a bit lengthy to go into unless the user really wants to know about it.  It takes more than a few lines to describe 3NF.  Also, a flat file _can_ be in 3NF, although it is not likely.
0
All Courses

From novice to tech pro — start learning today.