Slashdot Mirror


Open Source XML Databases?

tarun asks: "I am creating the next version of my open source UDDI registry and decided to use an XML database backend - if I can find any good ones. The reason to make this choice was that I was impressed by oracle and db2's xml capabilities in my past lives. However, when I tried looking for an open-source alternative it seems there is nothing around except perhaps xindice -which clearly is less then perfect. I am looking for something that can work with more than one existing databases (I will ship my software with MySQL but if a large organization wants to deploy it, it should be able to do it using Oracle, DB2 or whatever they want to use) and xindice currently only works with Berkley-DB. Also, I am looking for something that can create database tables for me given an XML schema (I can tweak it later to create indexes, stored procedures etc) and given an XML document - write it to these tables. If it supports something standard like Xupdate or XQuery, that is even better."

"There are some other XML Database projects but either they have too few features or are not open-source. What is the XML-aware portion of the Slashdot community using? Have you ever run across such problems? Do you guys create your database schemas by pain-stackingly copying every element in every XML schema you have to handle to database tables and write huge amount of parsing/deparsing code both ways?"

3 of 19 comments (clear)

  1. Use an XMLJavaDB toolkit by jefflinwood · · Score: 4, Informative
    Try using an XML to Java toolkit with a Java object-relational mapper. XML Databases aren't really all they are cracked up to be. Really quickly, projects you should look at are: Also you might want to check out Brett Mclaughlin's O'Reilly book on Java XML binding's, or the Wrox Professional Java XML book.
  2. Why XML? by jacoberrol · · Score: 4, Interesting

    Could someone explain to me the benefits of an XML database? I can't think of an XML document that can't be expressed as a relation. I've seen vague references to performance advantages and ease of development for certain applications, but I haven't heard a convincing argument. Am I missing something, or is this just XML hype?

    1. Re:Why XML? by DevilM · · Score: 5, Informative

      Sure! To use XML with an RDBMS you have to do one of two things. First, map the XML to a relational schema. It is well understood that doing this has two main problems. The first problem is the resulting schema. To create a schema to support heirarchical data results in a complex and ugly schema. The second problem is a spatial one. To retrive a given XML document, the database must pull data from a variety of pages. This results in poor performance as the database has no context to store the different bits of an XML document together on the disk. FYI, this one of the main reasons for the creation of OO databases.

      The second way of handling XML in an RDBMS is to store the document as a CLOB. Storing it as a CLOB has the advantage of solving the two above issues, but introduces one of its own; You can't query the data that is represented by the CLOB because it is all stored in a single column. This means you have to extract the document from the CLOB and parse it before being able to use any of the data. Some databases now have built in XML parsers so you can do this from stored procedures and combine the XML document with tabular data, but the performance sucks.

      I do cover why you would want to use an XML database and how to use Xindice in an article I wrote for DevX that can be found here.