Igor Serebryany
Igor Serebryany

Reputation: 3331

where does the term flat-file come from?

I was wondering if anyone knows. Is 'flat' the opposite of hierarchal? Does it come from a phrase like, "this is a flat-out regular file"?

Upvotes: 11

Views: 1921

Answers (5)

Archie Wood
Archie Wood

Reputation: 51

There is not a standard definition of a flat file, but the closest thing to a definition I have found suggests:

  • Text-only
  • No built-in compression
  • No index
  • Tabular format: one table per file, row-based organization of records
  • No metadata: no embedded metadata or schema information
  • Unstructured: no hierarchy or relationships between records or fields

My hunch is the flat comes from lack of structure, and the fact than only one table is stored per file (so 2D)

Upvotes: 0

Kathy Van Stone
Kathy Van Stone

Reputation: 26271

Looking at the wikipedia article (and one of its references), the 'flat' in flat file is as opposed to structured file, where the structure can be heirarchical, relational, or a few other formats.

Upvotes: 4

Derrick Turk
Derrick Turk

Reputation: 4336

Your speculation is correct: flat files are "flat" in that they do not have an internal hierarchical structure.

Upvotes: 0

Byron Whitlock
Byron Whitlock

Reputation: 53850

A flat file is read into a flat data structure, it is essentially an array. One big flat list of values.

A better way to store data would be in a binary tree for example. this data is not flat as it has a root and nodes.

A non flat data structure makes sorting and search much more efficient.

Upvotes: 2

Ravi Vyas
Ravi Vyas

Reputation: 12365

Well an imaginative way would be flatfiles can be imagined in one plane, a flat surface ,the more complicated DBs have connection between tables which can only be imagined in 3d :P

Upvotes: 1

Related Questions