Flat Files vs. Databases
Databases are used everywhere information is stored. You might not recognize it on the first pass, but any large collection of information can be considered a database. One of, if not the first usages of the term database was described in a paper by Kenneth A. Swanson in November of 1963 in a study on “A COMPUTER-CENTERED DATA BASE SERVING USAF PERSONNEL MANAGERS.”
Abstract : The paper discusses the use of computers to assist in the management of personnel. It describes guidelines for system development, an overview of the total process, and the effective use of a data base. Long-range needs are considered and some conclusions are drawn as to the application of a data base to the important area of personnel.
From the very beginning, databases were designed with the goal of storing important data for long periods of time while ensuring that data was well structured and integrity from record to record was enforced. As time passed, more research was conducted, better ways of expressing real world relationships were developed (Relational, Hierarchical, Network, etc..) and more importantly, better ways of managing these increasingly large amounts of data were introduced.These data management techniques spawned database management systems that we now employ today.
Forget text files- here’s a .php only database system is a post by the very intelligent Ankur, where he discusses instances where database management systems are perhaps overkill and ways that you can store information inside a file using PHP.AK’s a smart guy. Just look at what he’s done with Quicksilver. I can’t agree with the blog post, I find allowing PHP to have write access to files on disk to be more trouble than it is worth and I also happen to firmly believe that projects that can’t benefit from a DBMS system to be few and far between. I also happen be very biased towards using database management systems, which does also contribute to my feelings in this matter. What is unfortunate, is that it seems that his blog post is getting quite a bit of traffic from the wrong kinds of queries.
AK readily admits it in a comment post.
I agree with what you’re saying. One of the reasons this post comes across in a way I didn’t intend is due to the high ranking in Google - it’s not a good thing that people are reaching this article when searching for a solution they can implement.
To that effect, I feel that it’s important enough to warrant a blog post, in the hopes that perhaps someone searching for a way to avoid a database system will receive a very strong message.
DON'T
Complaints that “SQL is too hard” or that “SQL queries are such a pain to write” will fall on deaf ears as well as any concerns about “bloat” or “slow performance” compared to simple flat files. These concerns can be allayed by the fact that SQL databases scale with proper planning, feature referential integrity as well as consistency checks and also allow robust access control solutions. A fair trade for any small speed differences.The discussion about file size is a moot point, since a well structured and 3NF compliant database design will allow you to enter data ONE TIME and reference the data in all occurrences as the number of records increase. Duplicate records and data are a thing of the past.
Learning SQL and DBMS systems can be an uphill battle. I watched several classmates struggle with the concepts of database management systems during the previous semester. Admittedly, DBMS and SQL requires you to create new ways of thinking about data and relationships in order to fully realize the power of SQL. It’s much like riding a bicycle. After a while, you wonder how you got by.