Title: Native XML Databases : Why Bother
1Native XML Databases Why Bother?
Kimbro Staken The dbXML Group http//www.dbxml.com
The dbXML Open Source Project http//www.dbxml.or
g
2What 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.
3Why 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
4The 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
5Different 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
6How Do You Query
- W3C XPath
- Most common language currently used
- W3C XQuery
- Recommendation expected mid 2002
- Proprietary Languages
- Over time these will go away
7Querying with XPath
- Simple yet powerful path based XML query language
- /root/nodecriteria 'value'
- Many products extend XPath to allow queries
across collections of documents - Limited in many ways
- No grouping
- No sorting
- Limited data typing
8Querying 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
9XQuery Syntax Example
ltresultsgt FOR b IN document("http//www.bn.c
om")/bib/book, t IN b/title, a IN
b/author RETURN ltresultgt t
a lt/resultgt lt/resultsgt
10How do you Update Data
- W3C DOM / SAX / JDOM
- XMLDB 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
11XUpdate Example
ltxumodifications version"1.0"
xmlnsxu"http//www.xmldb.org/xupdate"gt
ltxuremove select"//_at_name'John'"/gt
ltxuupdate select"/addresses/address1/city"gt
Las Vegas lt/xuupdategt
lt/xumodificationsgt
12Schemas
- 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.
13The 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
14The 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
15The End
Questions?