When would I use XML instead of SQL? [closed] When would I use XML instead of SQL? [closed] xml xml

When would I use XML instead of SQL? [closed]


To quote This Book (Effective XML: 50 Specific Ways to Improve Your XML):

“XML is not a database. It was never meant to be a database. It is never going to be a database. Relational databases are proven technology with more than 20 years of implementation experience. They are solid, stable, useful products. They are not going away. XML is a very useful technology for moving data between different databases or between databases and other programs. However, it is not itself a database. Don't use it like one.“

I think this sums it up, if a little bluntly. XML is a data interchange format. One can have XML parsing libraries that can query a DOM with XPath expressions but that is not the same thing as a DBMS. You can build a DBMS with a DOM/XPath interface but to get ACID properties or scale to large data sets you need to implement a DBMS engine and a data format with indexes, logging and other artifacts of a DBMS - which (by definition) makes it something other than XML.


Use XML to create files that need to be sent to other applications. XML is more suited as data interchange format than as data storage format.

The following link is not bad to describe when using XML: Why should I use XML ?


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.