XML database
From Wikipedia, the free encyclopedia
In Software engineering, an XML database is a data persistence software system that allows data to be imported, accessed and exported in the XML format.
Two major classes of XML database exist:
- XML-enabled. These map all XML to a traditional database (such as a relational database), accepting XML as input and rendering XML as output.
- Native XML (NXD) The internal model of such databases depends on XML and uses XML documents as the fundamental unit of storage.
Note: "XML-enabled" implies that the database does the conversion itself (as opposed to relying on middleware).
Contents |
[edit] Rationale for XML in databases
O'Connell (2005, 9.2) gives one reason for the use of XML in databases: the increasingly common use of XML for data transport, which has meant that "data is extracted from databases and put into XML documents and vice-versa". It may prove more efficient (in terms of conversion costs) and easier to store the data in XML format.
Database models |
---|
Common models |
Other models |
Associative |
[edit] Native XML databases
The term "native XML database" (NXD) can lead to confusion. Many NXDs do not function as standalone databases at all, and do not really store the XML in true native (text) form.
The formal definition 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 include 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.
- Need not have any particular underlying physical storage model. For example, NXDs can use relational, hierarchical, or object-oriented database structures, or use a proprietary storage format (such as indexed, compressed files).
Additionally, many XML databases provide a logical model of grouping documents, called "collections". Databases can set up and manage many collections at one time. In some implementations, a hierarchy of collections can exist, 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 provides a simple pathing system that allows users 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 retrieved from the database. XSLT provides a declarative language written using an XML grammar. It aims to define a set of XPath filters that can transform documents (in part or in whole) into other formats including Plain 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. Users sometimes refer to its syntax is sometimes referred to as "FLWOR" (pronounced 'Flower') because the flow may include the following statements: 'For', 'Let', 'Where', 'Order' 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 resembles ODBC as used with relational databases.
[edit] Implementations
- VTD-XML, a native XML index back-compatible with XML.
- Tamino XML Server, the first Enterprise-scale native XML database with High Availability. Uses XQuery. Provides WebDAV, versioning, non-XML indexing and many APIs.
- MarkLogic Server, a native XML database which uses XQuery.
- Berkeley DB XML, embeddable database; re-branded as Oracle Berkeley DB XML
- DB2 9 Express-C, no-charge PureXML Hybrid Data Server
- SQL Server 2005, Free Express Edition with full xml features
- eXist-db, open-source native XML database
- Oracle XML DB (as of Oracle 9 known as Oracle XDB)
- Sedna, native XML DBMS
- 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)
- XStreamDB, native XML Database
- 4suite Python-based open-source native XML database
- Apache Xindice
- MonetDB/XQuery - XQuery processor on top of the MonetDB relational database system. Also supports W3C XQUF updates. Open source.
[edit] External references
- 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
- Initiative for XML Databases Note: last updated 2003