In a recent IDN interview, Jason Hunter makes a few bold claims about XQuery, the XML query language. While many efforts at query languages have emerged in recent years, few achieved the ubiquity of SQL and free-text search. Will XQuery fare better?
Yesterday we posted here about Domain-Specific Languages (DSLs), and no DSL is more popular than SQL, the Standard Query Language. Indeed, many developers prefer relational databases to alternative data stores because relational databases are optimized to execute SQL queries over the data they manage.
While there have been many alternative approaches to database management, such as object-oriented (OO) databases, content repositories, and hierarchical databases, few achieved the wide adoption of relational databases. Some of these non-relational databases are easier to develop with than with their relational brethren. For instance, using an OO database, there is no object-to-relational mapping issue to deal with: you just save your object graph as it exists in memory.
The problem with these alternatives, however, appears the other way around, in getting data out of the database. Although all these alternatives sport their own query languages, few of them support rich SQL query access to the data.
XQuery claims to do for XML what SQL has done for relational data. And XQuery is already widely supported, since the major database vendors now provide XQuery interfaces with their products. Will XQuery match SQL's popularity, or will it be just another query language used in niche applications? Jason Hunter, of servlets, JDOM, and the Apache Software Foundation's fame, seems to think the former:
Imagine that you could search all the books on your wall for examples of how to use the ‘Shift’ function in Perl." Hunter then suggests, “With Google you can get results that say ‘Here are some results with the word shift and the word Perl is near it. Is that good enough?’ Well, frankly, that isn’t good enough, so you want some way to get more intelligent results. And that’s what XQuery can do.
[...] The market for XQuery-empowered content sites is only just beginning [...] All sorts of publishers, government agencies and research firms are just waking up to the possibilities and power of XQuery, and that is also making this a lot of fun.
Do you agree with Jason's comments? Have you used XQuery in your applications?
i suppose if folks think that regressing to 1964 (the year IMS was released) is a good thing to do, then i would consider they're doing that a competitive advantage to those of us who don't.
while it is true that RDBMS vendors are blowing in the xml wind, it is also true that they are strengthening the R part of their databases. DB2 for the mainframe has recently gotten the functionality previously available for LUW, MySql now has a DB2 compatible stored procedure language, and sqlserver 2005 adds MVCC support (among other things; sqlserver may have finally grown up).
coders don't generally understand data. they still have the view that COBOLers had in 1960. shame on them.
It depends. Maybe if a lot of people are providing data in a standardized xml format, this could be very helpful. DMOZ, for example, has its entire database in rdf, available online. If we can search that data with xquery, that would be cool. I have never used xquery, but it looks pretty verbose. It would be better if it were more like regex: quich throwaway queries for xml, but more powerful than xpath.
I don't think that this is going to replace relational databases though.