XQuery versus SQL/XML

June 26, 2008

XQuery and SQL/XML are two standards-based languages for retrieving information from XML. Many XML storage vendors support for both standards. Although, as is typical for standards implementation, those vendors have varying degrees of support for the standards.

Recently, some people asked me whether XQuery or SQL/XML will win the XML retrieval wars. This question surprised me. You see, I believe there is a valid need for products to support both.

XQuery is a W3C Recommendation. It is supported by vendors like IBM, Oracle, and Microsoft. The language includes features like variables, data types, operators, conditional expressions, and functions. It uses XPath expressions to select information from XML. So XQuery is, in essence, a new language for many people to learn.

SQL/XML, on the other hand, is a set of extensions to SQL. It consists of the XML data type, a collection of XML publishing functions, conversion functions, schema validation functions, and more. SQL/XML was developed by INCITS H2.3, with participation from Oracle, IBM, Microsoft, and others. So SQL/XML is, in essence, an extension to an existing language.

There is a valid need for both.

Some developers are already comfortable with XML development. These developers will easily adapt to XQuery. Also, in many circumstances, XQuery offers developers a strong combination of programming power and ease of use. Finally, XQuery offers strong performance for many XML tasks. Although, each implementation of XQuery and its accompanying database are different, so please verify your vendor’s performance in this regard.

SQL/XML, on the other hand, is ideal for environments where developers are comfortable with SQL programming. When you consider the maturity of the SQL language, together with the strong API support and domain knowledge for query optimization, you realize that SQL/XML is ideal for certain environments. It may take more effort to code certain XML tasks in SQL/XML, but that may be acceptable in some environments.

So I believe that certain environments will favor one language over the other, that there is no reason why both languages can’t exist, and that it is good to allow people to choose the language that suits them best. What do you think?

Viral Video – Tuesday

June 20, 2008

Here is part 2. Enjoy…

Viral Video – Monday

June 16, 2008

This is the first in a series of three viral videos that show off IBM’s sense of humor, showcase the pureXML capabilities, and highlight IBM’s focus on green technology. I’ll post episodes two and three when they become available. I hope you enjoy.

Maybe this will inspire you to enter the video contest over at IDUG 🙂

The International DB2 Users Group (IDUG) recently announced the Search for the XML Superstar contest. IDUG is an independent, not-for-profit, user-run organization who promote the effective use of the DB2 family of products. Naturally the focus of the contest is to teach people about databases and the storage and retrieval of XML data.

The contest consists of education, followed by a series of quizzes to test your understanding. It then proceeds to a fully-blown programming contest. There is also a video contest. Cool prizes include laptops, Nintendo Wii, and the Segway i2 personal transport system!

If nothing else, this is a great opportunity to learn about XML and get some goodies at the same time. All details of the contest do not appear to be available as I write this post. The organizers say they will post them to the Channel DB2 Web site soon.