next
Database vs. File
Why not use a text file in a tab-separated column format?
for some simple applications, do exactly that!!!
but here are some reasons why a file stinks:
- you need to read the file
- you need to parse the file
- you need to deal with the column separator occuring within a column
- you need to update the file
- you need to write the file
- you need to protect the file from tampering
- you need to protect the file from simultaneous updates
- you need to enforce column constraints
- you need to search the file
- you need to perform complicated searches on the file
- you need to index the file on multiple columns for fast access
- you need to provide functions for all kinds of column manipulations
- you need to sync the file across multiple slave or backup servers
- you need to enable queries involving an unlimited number of such files, mixing arbitrary column types
- you need to incorporate multiple man-centuries of high brain power in your file-access design for optimal performance
- you need to enable access to the file contents from multiple languages and applications, perhaps remotely
- many more reasons...
all these details are managed beautifully for you when using a good database engine!