XML file compared to a relational database

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

What parameters do you consider when choosing between a "real" database and a flat XML file base? When should I use one over the other and under what circumstances will I never consider using a flat (or vice versa) relational database?

+4
source share
4 answers

There is no such thing as a database with flat xml files. Flat xml files are non-databases, since they do not have higher functions, such as indexes, they enjoy large datasets and queries or analytic queries without any index.

XML databases are another topic and may have their own needs (content management, document storage in general - complex schemes that you don’t care too much from the database point of view).

Flat files are great for things like 8smaller file settings), but the real database is a real database. ACID conditions are difficult to guarantee for flat files.

+4
source

To add to the answer of Rachel.

  • concurrency
  • read and write

If you have something simple that is often read and will not change much, it may be more optimal to use a flat file and save overhead.

On the other hand, if you need to support multiple connections that will add and update the data that you want to use in the database.

+3
source

A few options to consider -

  • Amount of data
  • Data complexity
  • The relationship between data

If we have less data with low complexity and no relationship than people go to a flat file, but this rarely happens in a real application, and therefore you will always use relational databases.

+1
source

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

0
source

Source: https://habr.com/ru/post/1305944/


All Articles