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.

Leave a Comment