I can serialize my data to harddisk. How can I know it is time to use a database to store my data?
All sorts of possible reasons:
- you get fed up of maintaining your serialisers
- the data is accessed by more than one program (say back office update and web-facing query written in PHP)
- the data is accessed by more than one machine (or machine architecture)
- the data becomes so large that simple files no longer scale efficiently
- the data has lots of internal relationships (eg customers and orders)
- you find yourself writing ad-hoc query languages to search your data
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Also keep in mind that "a database" doesn't necessarily mean a separate entity on your network. If you're not familiar with embedded databases like Berkeley DB or Sqlite, take a look. They're a very lightweight way to get many of the benefits Salem mentioned without a lot of extra set up.