XML database
From Wikipedia, the free encyclopedia
There are two major classes of XML database.
- XML-enabled. These map all XML to a traditional database (e.g. relational) accepting XML as input and rendering XML as output.
- Native XML (NXD) The internal model of such databases is based on XML and the fundamental unit of storage is an XML document.
Note: 'XML-enabled' implies that the database does the conversion itself as opposed to middleware.
Why XML in databases? O'Connell (2005, 9.2) states that one of the reasons is that XML is increasingly used for data transport, which has meant that "data is extracted from databases and put into XML documents and vice versa". It may be more efficient (in terms of conversion costs) and easier to store the data in XML format.
[edit] Native XML databases
The term "native XML database" (NXD) is deceiving in many ways. Many NXDs aren't really standalone databases at all, and don't really store the XML in true native form (i.e. text). To get a better idea of what a NXD really is, let's take a look at the NXD definition offered by the XML:DB Initiative.
The formal definition of a Native XML Database from the XML:DB consortium states that a Native XML Database...
- 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.
- 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.
- 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.
Additionally, many XML databases provide a logical model of grouping documents, called 'Collections'. Many collections can be created and managed at one time. In some implementations, collections can also be laid out in a hierarchical fashion, much in the same way that an operating system's directory structure works.
All XML databases now support at least one form of querying syntax. Minimally, just about all of them support XPath for performing queries against documents or collections of documents. XPath is a simple pathing system that allows you to identify nodes that match a particular set of criteria.
In addition to XPath, many XML databases support XSLT as a method of transforming documents or query results that are being retrieved from the database. XSLT is a declarative language written using an XML grammar. Its purpose is to define a set of XPath filters that will be used to transform documents in part or in whole into other formats including Text, XML, HTML, or PDF.
Not all XML databases support XQuery to perform querying. XQuery includes XPath as a node selection method, but extends XPath to provide transformational scaffolding. Its syntax is sometimes referred to as FLWR (pronounced 'Flower') because the flow may include the following statements: 'For', 'Let', 'Where' and 'Return'
Some XML databases support an API called the XML:DB API (or XAPI) as a form of implementation-independent access to the XML datastore. In XML databases, XAPI is analogous to ODBC for relational databases.
[edit] Implementations
- [1] Oracle Berkeley DB XML
- [2] XStreamDB Native XML Database
- DB2 9 Express-C No Charge PureXML Hybrid Data Server
- eXist open source native XML database
- 4suite Python-based open source native XML database
- Sedna native XML DBMS
- Apache Xindice
- Timber, a native XML database system developed at the University of Michigan
- X-Hive/DB, a commercial native XML database including XQuery implementation
- XQuest a native XQuery database engine written in Java (Free edition available)
[edit] References
- [3]XML Data Stores: Emerging Practices
- Bhargava, P.; Rajamani, H.; Thaker, S.; Agarwal, A. (2005) XML Enabled Relational Databases, Texas, The University of Texas at Austin.
- O'Connell, S. Advanced Databases Course Notes, Southampton, University of Southampton, 2005
- Much information about XML Databases [4]ja:XMLデータベース

