Well let us talk simple here and start from the beginning so that even a dummy can understand it. lol. Actually the explanantion below is mostly taken from an excerpt from the dummy web sete.
Flat files are text files stored in the computer file system. Humans can read flat files very easily by using the operating system commands that display files, such as cat in Linux and Unix or even notepad in windows! You can access and edit these files by using any text file editor, such as Notepad or vi. The information in the flat file is stored as strings, and the java, vb c and whatever program or PHP, asp, jsp or whatever server side script that retrieves the data needs to know how the data is stored. For example, to retrieve a customer name from a file, the PHP script needs to know that the customer name is stored in the first 20 characters of every line.
Using a database for data storage requires you to install and learn how to use database software, such as MySQL or Oracle. The data is stored in files created by the database software and can only be accessed by the database software. Databases can store very complex information that you can retrieve easily. You don't need to know how the data is stored, just how to interact with the database software. For example, to retrieve a customer name, a PHP script needs to know only how to tell the database software that it wants the customer name, using a standard communication language called SQL. The database software handles the storage and delivers the data, without the script needing to know exactly where or how the customer name is stored.
Flat files have some advantages over databases:
Flat files are available and versatile: You can create and save data in any operating system's file system. You don't need to install any extra software. Additionally, text data stored in flat files can be read by a variety of software programs, such as word processors or spreadsheets.
Easy to use: You don't need to do any extra preparation, such as install database software, design a database, create a database, and so on. Just create the file and store the data with statements in your PHP script.
Smaller: Flat files store data by using less disk space than databases.
A flat file is quick and easy and takes less space than a database. It is ideal for storing small amounts of information quickly, such as a simple list or small piece of information. Flat files are particularly useful for making information available to other software, such as an editing program or a spreadsheet. Flat files can be looked at by anyone with access to the computer directory where they are stored, so they are useful when information needs to be made available to other people.
DK once told me that yahoo still uses flat file for its primary database. That yahoo has always been using flat files from the beginning. It's hard to believe though. Who knows where he got that information!
Databases have some advantages as well:
Security: A database provides a security layer of its own, in addition to the security provided by the operating system. A database protects the data from outside intrusion better than a flat file.
Accessibility of data: You can store data in a database by using a very complex data structure, specifying data types and relationships among the data. The organization of the data makes it easy to search the data and retrieve what you need.
Ability to handle multiple users: When many users store or access data in a single file, such as a file containing names and addresses, a database ensures that users take their turn with the file to avoid overwriting each other's data.
Databases require more start-up effort and use more space than a flat file, but are much more suitable for handling complex information. The database handles the internal organization of the data, making data retrieval much simpler. A database provides more security, making it more suitable for sensitive, private information. Databases can more easily and efficiently handle high traffic when many users may try to access the data almost simultaneously.
In PHP 5, SQLite, an extension for data storage that combines the main advantages of flat files and databases, is included by default. SQLite stores the data in a flat file, so you don't need to install database software, but you store data using SQL, the standard database communication language. SQLite is a quick option for storing and retrieving small amounts of data in a flat file using SQL. SQLite is not a good option for really huge, complicated databases.
Also it has been rumored and I suppose it is true use that complicated flat file database that is accessed very actively causes system performance degradation severly.
So the choice is simple really, you can go with flat files for smaller projects. Larger projects go with mysql, ms access or oracle.
_________________
Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.