Note: You are viewing an old revision of this page. View the current version.

FlatFiles refers to a method of storing data which makes use of basic files. There is normally no ordering, nor is there any indexing.

/etc/passwd is a typical example of this.

The 'Flat' refers to the lack of ordering or hierarchy within the files.

FlatFiles are inefficient for large volumes of data, as lookups tend to be O(n) and there is no way of placing an index on the file. If you are using a very large [[FlatFile and want to improve performance, try storing its contents in a better FileFormat, such as a dbm, or a good SQL database.

Most configuration files are in !FlatFile format. This is normally fine, but in some cases you want good dynamic control over the contents of the files. If the program you are using cannot support a better FileFormat than FlatFiles, then you could always store your data however you like - eg in SQL or LDAP, and have a script which runs regularly and updates the FlatFiles your program relies on.