How the database approach is different from flat file data management?

Determining the type of database to be deployed for a project is a combination of access requirements and preference. To make an informed decision on which to deploy, the application engineer should be familiar with the types of databases as well as the pros/cons of each. In this entry, we will consider two general types of databases and explore some of their applications and key points in the decision cycle when faced with a project.

“Flat File” databases consist of formats including single or multiple record types, and come in flavors of fixed-length definitions and delimited. The simplest form of flat file is a standard text file and consists of a single record definition. The record or “row” (as commonly referred to) repeats from one to many times, with each successive row representing a common definition. Every row is made up of a horizontal list of fields and the same definition of the row can be applied to every row in the file.

More complex forms of flat files would consist of multiple record definitions, where one or more records would have similar columns to others, yet some rows would vary in layout and content. These multiple record formatted files will use a template or record identifier to distinguish how the remaining items in the row should be interpreted.

Fixed length definitions structure each column across the row with a defined start and stop position. Delimited structures may have a predefined minimum and maximum length but the start and stop position of each column is indicated by a “special” character value.  These characters imply the end of a column and therefore can only exist within the data content of a column under special circumstances such as within quoted values (values surrounded by typically double quotes “).

“Relational” databases take on the challenge of storing data of differing definitions or formats separately in what is referred to most often as “tables.”  Each table will consist of two groups of columns identified as key values and stored values. The key values make it possible to relate records in one table to another in a parent-child relationship or dependency.

Flat file databases are typically independent of each other or self-contained and require no outside architecture to define or store the data for later interpretation. They can easily be edited and printed directly without interpretation beyond the file specification (layout).  Relational databases will, however, require a structuring “container” often referred to as a database “server” which stores and interprets the “metadata” defining the content.

Although there are sets of standards each relational database can be structured for, they typically require an “interpreter” tool to edit or view the data. These interpretation tools are quite often made available as part of the database server or as an additional related product and can be proprietary in nature. Some “generic” tools function using a specific standard and can be shared over varying database servers.

Some common flat file formats would include Electronic Data Interchange (EDI) platform standard formats such as X12 and EDIFACT, eXtensible Markup Language or XML, and CSV or comma-delimited files often representing spreadsheets. Common relational database servers would include Microsoft SQL Server, Oracle Database Server, and MySQL.

Flat file databases are most often used in a “transactional” nature and when entire file processing is required, where Relational Databases are generally found in data warehousing implementations where direct record access is essential.

The database ultimately adopted will largely depend on the nature and purpose of the data, the database access requirements, any cost/budget variations, company in-house technical expertise, and knowledge of the other applications needing to access that database. Flat-file databases are simple and are essentially “free” but limit data access to manual processes and/or structured programs. Relational databases are generally more complex with varying costs but provide advanced capabilities and more efficient access options.

About Adam Hughes

Adam Hughes is a Content Marketing Manager at Cleo. Previously, he spent over five years at TechTarget as a News Editor and Managing Editor covering cloud computing, mobility, and other emerging technologies.

Tags

A database is a collection of data, which is organized into files called tables. These tables provide a systematic way of accessing, managing, and updating data. A relational database is one that contains multiple tables of data that relate to each other through special key fields. Relational databases are far more flexible (though harder to design and maintain) than what are known as flat file databases, which contain a single table of data.

To understand the advantages of a relational database, imagine the needs of two small companies that take customer orders for their products. Company A uses a flat file database with a single table named orders to record orders they receive, while Company B uses a relational database with two tables: orders and customers.

When a customer places an order with Company A, a new record (or row) in the table orders is created. Because Company A has only one table of data, all the information pertaining to that order must be put into a single record. This means that the customer's general information, such as name and address, is stored in the same record as the order information, such as product description, quantity, and price. If customers place more than one order, their general information will need to be re-entered and thus duplicated for each order they place.

Whenever there is duplicate data, as in the case above, many inconsistencies may arise when users try to query the database. Additionally, a customer's change of address would require the database manager to find all records in orders that the customer placed, and change the address data for each one.

Company B is much better off with its relational database. Each of its customers has one and only one record of general information stored in the table customers. Each customer's record is identified by a unique customer code which will serve as the relational key. When a customer orders from Company B, the record in orders need contain only a reference to the customer's code, because all of the customer's general information is already stored in customers.

This approach to entering data solves the problems of duplicate data and making changes to customer information. The database manager need change only one record in customers if someone changes addresses.

This is document ahrp in the Knowledge Base.
Last modified on 2019-06-18 14:45:56.

What are the main difference between DBMS and flat file management system?

File System Vs DBMS: Explore What is the Difference between File System and DBMS. File System helps to store a collection of raw files of data into a hard disk, while DBMS is a software system, and it helps to store, manipulate or recover data.

What are the key differences between the file based and database approaches to data management?

The difference between file system and DBMS is that file system helps to store a collection of raw data files into the hard disk while DBMS helps to easily store, retrieve and manipulate data in a database. In brief, DBMS provides more flexibility in accessing and managing data than the file system.

How database approach is different from traditional file system?

In a traditional file processing system, each user defines and implements its own modifications to the files needed for a selected software application as a part of programming the appliance. In the database approach, one repository maintains data which is defined once then accessed by various users in that database.

What is flat file database approach?

The answer to "What is a flat-file database structure?" is it's a system that stores all its data in a single table. While many databases rely on relational systems, where the files from multiple tables correspond to established relationships, a flat-file follows a much simpler structure.