views:

340

answers:

4

Most projects now need some form of a database. When someone says database, I usually think relational databases, but I still hear about flat file XML databases.

What parameters do you take into consideration when deciding between a "real" database and a flat-file XML database. When should one be used over the other, and under what circumstances should I never consider using a flat file (or vice versa a relational) database?

+1  A: 

Few Parameters to consider is

  1. Amount of Data
  2. Complexity of Data
  3. Relationship between Data

If we have less amount of Data with low Complexity and no inter-relationship than people would go for Flat file but in real application this is rarely the case and so you will always find Relational Databases used very often.

Rachel
+3  A: 

There is no such thing as a xml flat file database. Flat xml files are non-databases in that they have no higher functions like indices - have fun with larger datasets and searches or analytical queries without any index.

XML databases are another topic and may have their needs (content management, document storage in general - complicated schemata you dont care too much from the database point of view).

Flat files are fine for things like settings 8smaller files), but a real database is a real database. ACID conditions are hard to guarantee for flat files.

TomTom
I beg to differ. An xml flat file can be a database. A flat file can be a database. What they are not is DBMSs (DataBase Management System).
Oded
+2  A: 

To add to Rachel's answer.

  • concurrency
  • read vs. write

If you have something simple that's going to be read often and is not going to change much it might be more optimal to use a flat file and save the overhead.

On the other hand, if you have to support multiple connections that are going to be adding and updating the data you'll want to use a database.

digitaldreamer
For writing, let's say not frequent writes and only by a single admin. For reads, would a relational database like MySQL choke up on multiple connections reading?
donpal
No, and it would handle them faster (less ressource intensive) than XML even for small data amounts.
TomTom
A: 

XML file is not a database. Read Joel's "Back to basics" article to see the difference.

Col. Shrapnel