
There are two main data formatting options for storing information in flat files: fixed widths and delimiters. The first row of a flat file contains the field name for each column in the database, and each row after the first represents a single record. In this section, we will delve a little deeper into the structure of flat file databases, and what a flat file system typically looks like.įlat file databases usually have a simple structure, reflecting the straightforward nature of the underlying data. The term “flat file database” also more broadly describes data repositories that can easily include a plaintext format-NoSQL databases that store unstructured data, Excel spreadsheets, Microsoft Word documents, JSON documents, etc. Each order would simply refer to the corresponding entry in the customer table, rather than duplicating the customer information for every order (as is necessary with a flat file database). A relational database would contain multiple tables: one for the order details and one for the customer's information.The columns of the table would include the order ID and order details, as well as the customer’s personal information (name, address, etc.). A flat file database used for this purpose would only contain a single table, with each record in the table describing an individual order.


To illustrate the difference between flat file databases and relational databases, consider an e-commerce company that needs to store information about its customers’ orders: This distinction makes flat file databases different from relational databases (also known as SQL databases), which typically use multiple tables to store information.
