There's a simple question to ask to help you determine whether your
application needs a native XML database: got XML? If the answer is yes, then
you need a native XML database. This argument is developed in more depth by
Ron Bourret at
http://www.rpbourret.com/xml/XMLAndDatabases.htm. The basic
idea is that if you are dealing with XML documents in any form, and you need
to store and retrieve them, then you need a native XML database.
As an example, I worked on a web service project in which we received an XML
payload, manipulated it in various ways into more XML documents, before
eventually writing the data to a relational database. Along the way we used
a native XML database to archive the XML payload document and all the
interim documents we created. If any questions arose at a later date about
the contents of the payload or how it was manipulated, we could query the
XML database and retrieve the original document.
Trying to shoehorn hierarchal XML data into a relational database is hard
work but if you have no other option then there are some tools out there to
help you:
· Most relational database vendors now offer XML extenders. These are
largely SQL functions and data types that help you work with XML data in an
SQL-like way.
· I've used an open source product called XML-DBMS. Through a mapping file
it's possible to take an XML payload and write the contents to a relational
database. Overall performance and functionality are good and there's an
active user forum to help you out if things get sticky.
· Altova (
http://www.altova.com/) have some tools to help with mapping
between relational databases and XML.
The key thing to remember is that relational and native XML databases are
not really in competition because they are working with fundamentally
different data structures. With a bit of work one can be made to perform the
duties of the other, for example by using some of the tools above, but it's
best to choose a database model that suits the structure of your data.
So, if you've decided that native XML databases are for you there are some
products worth evaluating:
· Berkeley DB XML(
http://www.sleepycat.com/). The site also has lots of case
studies of companies using native XML databases in the real world.
· Apache's Xindice (
http://xml.apache.org/xindice/). I evaluated this for
our web service project, but I think that at this stage of its development
there might be some limitations on the size of the XML documents it can
handle.
· The next major release of IBM's DB2 will include native XML support.
Personally, I find the Berkeley product good to use: it has a solid
programming APIs, lots of documentation, and the Stylus Studio editor
provides a GUI interface.
Also, check out the following book for some comparisons and evaluations of
native and hybrid XMl databases: Chaudhri, A. B., Rashid, A. and Zicari, R.,
(eds.). (2003). XML Data Management: Native XML and XML-Enabled Database
Systems. Boston: Addison Wesley.