Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 15

Native XML Databases : Why

Bother?

Kimbro Staken
The dbXML Group
http://www.dbxml.com
The dbXML Open Source Project
http://www.dbxml.org
What is a Native XML Database
a) Defines a (logical) model for an XML document -- as opposed to the
data in that document -- and stores and retrieves documents according to
that model. At a minimum, the model must include elements, attributes,
PCDATA, and document order. Examples of such models are the XPath data
model, the XML Infoset, and the models implied by the DOM and the events
in SAX 1.0.

b) Has an XML document as its fundamental unit of (logical) storage,


just as a relational database has a row in a table as its fundamental
unit of (logical) storage.

c) Is not required to have any particular underlying physical storage


model. For example, it can be built on a relational, hierarchical, or
object-oriented database, or use a proprietary storage format such as
indexed, compressed files.
Why Native XML Databases
• Straightforward storage of XML
• XML oriented query facilities
• Semi-structured data
• Easier construction of loosely coupled
applications
• Tremendous flexibility and capability for change
• Not a replacement for RDBMS
The Problem with RDBMS and
XML
• Mapping is complex and cumbersome
• With complex schemas mapping will be very
slow
• Mapping will lose structural meta-data
• Documents can not be round-tripped
• Data must be highly structured
• Can't support documents with mixed content
• Limited flexibility
Different Types of Native XML
Databases
• Custom native storage
• Software AG Tamino http://www.softwareag.com
• dbXML http://www.dbxml.org (Open Source)
• XYZFind http://www.xyzfind.com
• Built on top of object database
• Excelon http://www.exceloncorp.com
• X-Hive http://www.xhive.com
• Ozone http://www.ozone-db.org (Open Source)
• Built on top of relational database
• B-Bop Xfinity http://www.b-bop.com
How Do You Query
• W3C XPath
• Most common language currently used
• W3C XQuery
• Recommendation expected mid 2002
• Proprietary Languages
• Over time these will go away
Querying with XPath
• Simple yet powerful path based XML query
language
• /root/node[criteria = 'value']
• Many products extend XPath to allow queries
across collections of documents
• Limited in many ways
• No grouping
• No sorting
• Limited data typing
Querying with XQuery
• Builds on top of XPath and XML Schema data
types
• Enables full data-typing
• Allows joins between XML documents
• Allows sorting and grouping
• Language is SQL like but works on trees rather
then tables
• Currently in working draft status
XQuery Syntax Example

<results>
{
FOR $b IN document("http://www.bn.com")/bib/book,
$t IN $b/title,
$a IN $b/author
RETURN
<result>
{ $t }
{ $a }
</result>
}
</results>
How do you Update Data
• W3C DOM / SAX / JDOM
• XML:DB XUpdate
• Usable today
• Useful beyond just XML databases
• W3C XQuery update extensions
• Expected at some point in the future
• Will not be part of XQuery 1.0
• Experimental syntax does exist
XUpdate Example

<xu:modifications version="1.0" xmlns:xu="http://www.xmldb.org/xupdate">


<xu:remove select="//*[@name='John']"/>
<xu:update select="/addresses/address[1]/city">
Las Vegas
</xu:update>
</xu:modifications>
Schemas
• Most native XML databases are schema
independent
• DTDs - Just say no
• Proprietary or extended DTDs
• W3C XML Schema will likely be supported
more widely in the future.
The Bad
• Products are immature
• Many standards are still in development
• Techniques are unfamiliar to people
• Not good at transaction processing
• Tool support is minimal
• Some expected database practices are still
unsupported
• Interoperability between products is minimal
The Good
• Good way to store XML
• Can store document or data style XML
• Tremendous flexibility
• Applications can be loosely coupled
• Data modeling is simple and flexible
• Complement RDBMS with XML mapping
solutions
• Performance can be very good
The End

Questions?

You might also like