When to use a Native XML Database
March 21, 2008
I recently discovered an excellent treatise on XML and Databases by Ronald Bourret. It is certainly worth reading. Mr. Bourret describes the various options for storing XML in databases. He claims that the most important factor in choosing a database is whether the information is data-centric or document-centric. I will take some liberties and paraphrase his descriptions:
- Data-centric information uses XML solely as a data transport mechanism. It is not important that the data is, for some length of time, in XML format. Examples are sales orders, flight schedules, scientific data, and stock quotes. For such cases, he recommends using a traditional database, such as a relational, object-oriented, or hierarchical database.
- For document-centric information, XML fulfills a greater role. In this case, the XML elements, attributes, and structure are meaningful and have value. Examples are books, email, advertisements, and hand-written XHTML documents. For such cases, he recommends using a native XML database or a content management system.
He does say that these rules are not absolute, without going into further detail. Let me describe some reasons why you may want to store data-centric information in a native XML database:
- Performance improvements. See my previous post for details regarding the performance for queries.
- Greater business agility. Respond quickly to dynamic conditions by easily accommodating changes to data and schemas.
- Lower development costs. Reduced code and development complexities lead to shorter development cycles when updating your systems or adding new applications.
- Improved business insight. Gain competitive advantage through better and quicker access to business insights.
- Space savings. Databases like DB2 use inlining and compression to realize between 3x and 6x space savings when storing XML data.
I will go into more detail on some of these reasons in subsequent posts.