Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why would people use pure XML databases over plain RDBMs?

Tags:

database

xml

How many of you are actually using pure XML databases over RDBMs? The former seem to be gaining momentum, but I don't understand the advantage. Anyone cares to explain?

like image 463
Dervin Thunk Avatar asked May 09 '09 20:05

Dervin Thunk


People also ask

Why do we use XML in database?

XML Database is used to store huge amount of information in the XML format. As the use of XML is increasing in every field, it is required to have a secured place to store the XML documents. The data stored in the database can be queried using XQuery, serialized, and exported into a desired format.

What is the difference between XML database and relational database?

Major differences between XML data and relational dataAn XML document contains information about the relationship of data items to each other in the form of the hierarchy. With the relational model, the only types of relationships that can be defined are parent table and dependent table relationships.

Why XML has become more and more popular with databases?

XML databases take advantage of these standards to provide efficient and precise access, query, storage, and processing capabilities not found in traditional database technology. The result is that applications using XML databases are more efficient and better suited for managing XML data.

Should I use XML or a database?

SQL is good tabular data -- data that easily fits into rows & columns. XML is good for hierarchical data -- data which has several levels of different sizes. SQL is good for storage & searching. XML is good for transmitting & formatting.


1 Answers

Conditions that suggest XML isn't a crazy idea

  • If your data looks like a collection of documents. For example, novels have structure, e.g. chapters, paragraphs, sentences, words. You might want to access the structure programatically, but it would be hard to make a relational schema that would support that.

  • A mind boggling number of fields and tables required, almost all are optional. For example, not all novels have a villain, but a villain attribute or tag would be easy enough to add to an xml document.

  • If you have a fairly small amount of data.

  • Data is strongly hierarchical. It is easier to query an XML document of a organizational chart than to do the similar query on an employee table with a manager column that links to itself.

Example- DasBlog which uses plain ole xml as the datastore.

Conditions that suggest a relational model is better

  • Most of your data fits nicely into tables and columns, fairly small numbers of fields, most fields are required.

  • There is a lot of data. The Relational world has been optimizing for performance much longer than the XML database world.

You can have it both ways

  • Most modern relational databases support xml as a first class data type.
like image 160
MatthewMartin Avatar answered Oct 29 '22 05:10

MatthewMartin