Types of Database You Should Use – Flat-File Vs Relational

Nowadays, majority of the websites that you see on the internet make use of a database in some or the other form. This technique of dynamically developing pages from databases is extremely useful and it will be relevant for several years to come. Therefore, it is advisable to know the types of database that you should use to fulfill your requirements. Databases are usually available in two forms – Single-file or the ‘Flat-file’ database and ‘Multi-file Relational’ or the ‘Structured’ database. So, which of these two basic systems should you use?

The kind of database that you need largely depends on the following four factors –

1. Data Quantity: The amount of data that needs to be processed and stored largely determines that kind of database you should go for. 2. Complexity of Data: Another factor that determines the database type is the level of complexity of the available data. Data may be in the form of images, sound files, or plain text. You must choose the database accordingly. 3. Number of Users: The number of people who would be able to access and amend data simultaneously is also an important determining factor. 4. Type of Action to be performed on the Data: You must also determine if the available data needs to be exported to or imported from the other IT systems.

In case you have simple requirements, such as monitoring the address and names of 100 employees, a spreadsheet or a similar office tool would suffice. However, if the requirements are complicated, involving large amounts of data, you would require a sophisticated database designed specifically to suit your needs. When it comes to the types of database you should use, you must consider the following two major database types –

Flat-File Database

Also known as the single-file database, it has the following main features-

– Best suited for storing and processing small quantities of data - Contain a string set in files that can be further parsed to obtain the stored information - Ideal for processing and storing simple forms of data, like small data values and simple lists. Note that a flat-file database can also store and process complicated data, but it takes more time, cost, and power in doing so.

Cons: It is highly susceptible to corruption. Also, it does not contain any inherent mechanism to lock and unlock files on each access. This has to be done manually at script level. Also, the possibilities of a file getting wiped clean by the processes while fighting for the lock or that of a busy script causing ‘race condition’ are very high.

Relational Database

Also known as the multi-file or structured database, it has the following main features –

– Has a more logically structured way of storing and processing large amounts of data - Cost-efficient and less time-consuming when it comes to storing complicated data - Uses two-dimensional and multi-dimensional tables to represent the real world objects; each field of the table represents an attribute, while each column represents a dimension - The tables are linked to each other by means of logically defined complex relationships. - Data redundancy minimized to a great extent - Have built-in functions to sort, edit, and retrieve data

Thus, you may choose between the two types of database according to the kind of data you wish to store and process. There are many other things that you must consider before choosing a particular database type.