SQL vs. XML in a database world

 

Connecting state and local government leaders

In a sense, Jonathan Robie acts as a diplomat between two disparate technologies'Extensible Markup Language and relational databases.

In a sense, Jonathan Robie acts as a diplomat between two disparate technologies'Extensible Markup Language and relational databases. Communicating between those two worlds is not a task for the faint-hearted. Advocates of the Structured Query Language, which allows users to access information in relational databases, are quick to point out XML's deficiencies, while XML adherents question the value of a relational model.Robie seeks to bridge these two worlds. He is one of the chief authors of XQuery, an SQL-like query language that can be used for searching both XML documents and relational databases. The World Wide Web Consortium, the international body that creates and maintains Web standards, is now reviewing XQuery as a formal draft.In addition to XQuery, Robie works on a number of other W3C working groups and is co-author of XQuery from the Experts, published by Addison-Wesley. In his day job, he's the XML program manager at data connectivity software provider DataDirect Technologies Inc. of Bedford, Mass. Previously, Robie was an XML Research Specialist at Software AG. He spoke to GCN associate writer Joab Jackson by phone.ROBIE: SQL is a relational query language, XQuery is an Extensible Markup Language query language. If all you are doing is querying relational databases, then SQL is the language you want. XQuery works best if you're querying XML or a combination of XML and relational sources.ROBIE: No. I was working for an object database company at the time [1995] and a medical textbook publisher contacted us, wanting a Standard Generalized Markup Language database. That was before XML. Since I was the person who knew the most acronyms in the company, the call was put through to me.I spent a lot of my career working with things that do not fit naturally into relational databases'geographic information systems, multimedia systems or things like that. The idea of an SGML database was exciting because the most important information in any organization is the document information. The standard clich' is that 90 percent of corporate data is not in databases, because it doesn't fit naturally in databases.ROBIE: Joe Lapp [then the principal architect of webMethods Inc.] and I had done most of the work on a language called XQL.In 1998, two query languages, XQL and XML-QL got a lot of interest within the W3C, so we got onto the W3C working group for XML-based querying languages. We spent the first year trying to figure out what our requirements were. We started out by doing use cases. We came up with a document that had about 90 queries, so we took about seven query languages and tried them out with these 90 queries. None of them were perfect. [For XQuery], we took the best part of each of the languages.ROBIE: The fundamental thing about them was that they relied on the structure of XML. XML's logical structure is based on hierarchy and sequence. Two things that relational databases don't do is hierarchy and sequence. Yet Web sites typically get a lot of information from databases, but they don't put two-dimensional tables up on the screen. You create hierarchies for that information. In XML you structure everything with hierarchy and sequence.ROBIE: Let me give you a scenario. Your Web site has a message coming in: Someone wants to ask for the price of some stocks. Now we can join XML documents and various relational tables. The XML documents will identify the person who wants the information. It will give the data range that person is interested in. We join that against a relational database to figure out how the stocks have performed, and we build an XML structure that contains the result.ROBIE: Yeah, I read your interview with [database consultant] Fabian Pascal. It depends on who you're talking about.Certain purists don't like it. If you remember back in the early days, some of the people who are kicking back against XQuery now were kicking back then against the use of null in SQL [to represent missing data]. They are the people for whom SQL and real relational databases just aren't pure enough and what should have existed never really got implemented.I think that since the standards boards of the International Standards Organization and the American National Standards Institute are in the process of adding all of XQuery into SQL, it is just hard to claim that the SQL community is not accepting XQuery. If you go to the major database conferences, you will see a lot on XML. Every relational database vendor has added XML support.People are very conservative about their database choices. But the flow of information is just as important as the control of information. For most information, if you want to exchange it, you use XML. People don't give every Tom, Dick and Harry a connection to their databases. And the way you get through the firewall is to send XML around.ROBIE: I think you are confusing physical characteristics with logical characteristics. In an XML database, you don't have to store the physical characters associated with every tag. If I have an XML view of the rows and tables of the relational database, it could be exactly the same size as the relational database.If the data is in a native XML database, then it depends on the physical design of the structures used to store things. But there is no reason it has to be more storage-intensive than a relational database.If you have a straight text file, then, yes, it will be large, but it is very repetitive information, which is easily addressed. There is work being done in binary XML, which is a much more compressed format.A database isn't just a bunch of two-dimensional tables with data. You have all these indexes, and the indexes can make the data several times larger than the original. XQuery right now is read-only, and it has no idea what a table is, by the way.ROBIE: We have two things. We are shipping today an XQuery implementation in Stylus Studio, which is an integrated development environment for XML.We'll also be developing over the coming year DataDirect XQuery. That will be an XQuery implementation that works with all the major relational databases and with XML sources, either in files, or in the Java programming space. You can query an XML file, or an Oracle, Microsoft, IBM, MySQL or Sybase database.ROBIE: Everyone gets frustrated by how long it takes. I've been doing standards since 1996. But I do feel that having several people with opposing points of view, who reach consensus on the requirements and on the design, results in a more general-purpose and better solution.

What's more

Family: Married, two daughters


Pets: One dog


Last book read: 'Life of Pi' by Yann Martel


Last movie seen: 'Shall We Dance?'


Leisure activities: Sailing and playing the flute

Jonathan Robie, XML evangelist







GCN: How is XQuery different from Structured Query Language?



GCN: How did you first start working with XML? Did you know it would consume a large portion of your career when you started?









GCN: How did that work on the SGML database lead to XQuery?







GCN: What was it about these use cases that made them unusual?



GCN: So how can XQuery help in that sort of situation?





GCN: It seems as if there is some resistance to the idea of using XML as a database tool from the relational database community.















GCN: It seems repetitive to add an XML tag to each record in a database. Don't XML databases require more storage space than relational ones?









GCN: What does DataDirect offer in terms of XQuery?





GCN: Do you enjoy working on standards boards? It seems like standards take a long time to develop.

NEXT STORY: Incoming

X
This website uses cookies to enhance user experience and to analyze performance and traffic on our website. We also share information about your use of our site with our social media, advertising and analytics partners. Learn More / Do Not Sell My Personal Information
Accept Cookies
X
Cookie Preferences Cookie List

Do Not Sell My Personal Information

When you visit our website, we store cookies on your browser to collect information. The information collected might relate to you, your preferences or your device, and is mostly used to make the site work as you expect it to and to provide a more personalized web experience. However, you can choose not to allow certain types of cookies, which may impact your experience of the site and the services we are able to offer. Click on the different category headings to find out more and change our default settings according to your preference. You cannot opt-out of our First Party Strictly Necessary Cookies as they are deployed in order to ensure the proper functioning of our website (such as prompting the cookie banner and remembering your settings, to log into your account, to redirect you when you log out, etc.). For more information about the First and Third Party Cookies used please follow this link.

Allow All Cookies

Manage Consent Preferences

Strictly Necessary Cookies - Always Active

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Sale of Personal Data, Targeting & Social Media Cookies

Under the California Consumer Privacy Act, you have the right to opt-out of the sale of your personal information to third parties. These cookies collect information for analytics and to personalize your experience with targeted ads. You may exercise your right to opt out of the sale of personal information by using this toggle switch. If you opt out we will not be able to offer you personalised ads and will not hand over your personal information to any third parties. Additionally, you may contact our legal department for further clarification about your rights as a California consumer by using this Exercise My Rights link

If you have enabled privacy controls on your browser (such as a plugin), we have to take that as a valid request to opt-out. Therefore we would not be able to track your activity through the web. This may affect our ability to personalize ads according to your preferences.

Targeting cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising.

Social media cookies are set by a range of social media services that we have added to the site to enable you to share our content with your friends and networks. They are capable of tracking your browser across other sites and building up a profile of your interests. This may impact the content and messages you see on other websites you visit. If you do not allow these cookies you may not be able to use or see these sharing tools.

If you want to opt out of all of our lead reports and lists, please submit a privacy request at our Do Not Sell page.

Save Settings
Cookie Preferences Cookie List

Cookie List

A cookie is a small piece of data (text file) that a website – when visited by a user – asks your browser to store on your device in order to remember information about you, such as your language preference or login information. Those cookies are set by us and called first-party cookies. We also use third-party cookies – which are cookies from a domain different than the domain of the website you are visiting – for our advertising and marketing efforts. More specifically, we use cookies and other tracking technologies for the following purposes:

Strictly Necessary Cookies

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Functional Cookies

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Performance Cookies

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Sale of Personal Data

We also use cookies to personalize your experience on our websites, including by determining the most relevant content and advertisements to show you, and to monitor site traffic and performance, so that we may improve our websites and your experience. You may opt out of our use of such cookies (and the associated “sale” of your Personal Information) by using this toggle switch. You will still see some advertising, regardless of your selection. Because we do not track you across different devices, browsers and GEMG properties, your selection will take effect only on this browser, this device and this website.

Social Media Cookies

We also use cookies to personalize your experience on our websites, including by determining the most relevant content and advertisements to show you, and to monitor site traffic and performance, so that we may improve our websites and your experience. You may opt out of our use of such cookies (and the associated “sale” of your Personal Information) by using this toggle switch. You will still see some advertising, regardless of your selection. Because we do not track you across different devices, browsers and GEMG properties, your selection will take effect only on this browser, this device and this website.

Targeting Cookies

We also use cookies to personalize your experience on our websites, including by determining the most relevant content and advertisements to show you, and to monitor site traffic and performance, so that we may improve our websites and your experience. You may opt out of our use of such cookies (and the associated “sale” of your Personal Information) by using this toggle switch. You will still see some advertising, regardless of your selection. Because we do not track you across different devices, browsers and GEMG properties, your selection will take effect only on this browser, this device and this website.