Your opinion on XML databases

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Low to awful performance for large databases, OK for small files.

Consider database table rows: in a normal database, these are fixed-length records (with pointers to any BLOBs or large-text fields), so you can seek to record N by just jumping to offset (start)+(index(N)-1 * rowsize), and you can read / buffer rows using buffer sizes known in advance. (Probably a little more complex if a table occupies multiple areas in the file, but in general it's an simple seek).

You can append new records to the file, and can also mark rows as dead to do garbage collection later, both without needed to rewrite the entire file. Neither operation is possible with XML.

With XML, record size is not fixed. Field order isn't required to be maintained. BLOBs must be converted to something like base 64, and either embedded in the record or perhaps linked to by ID (but with the position in the XML file not known, just "somewhere.".

XML only makes sense for little files, databases that are kept entirely in memory and only serialized to disk, and for exhanging data with another application.

There probably are some hybrid approaches by now, where part of the db record is a glob (or BLOB) of XML, but that's not really an XML database, just storing XML within a real db.