Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML flat file vs. relational database backend

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?

like image 876
donpal Avatar asked Apr 17 '26 08:04

donpal


2 Answers

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.

like image 166
TomTom Avatar answered Apr 19 '26 23:04

TomTom


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.

like image 33
digitaldreamer Avatar answered Apr 20 '26 01:04

digitaldreamer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!