XML database

From Wikipedia, the free encyclopedia

Template:Short description

Page Module:Message box/ambox.css has no content.

An XML database is a data persistence software system that allows data to be specified, and stored, in XML format. This data can be queried, transformed, exported and returned to a calling system. XML databases are a flavor of document-oriented databases which are in turn a category of database.

Rationale for XML as a database format

Reasons to store data in XML format as an XML database include:[1][2]

  • An enterprise may have numerous XML documents with similar data, but dispersed in different XML formats. Conglomerating this data into a singular, standardized XML database structure will avoid compatibility issues
  • Data may need to be exposed or ingested as XML, so using another format such as relational forces double-modeling of the data
  • XML is very well suited to parse data, deeply nested data and mixed content (such as text with embedded markup tags)
  • XML is human readable whereas relational tables require expertise to access
  • Metadata is often available as XML
  • Semantic web data is available as RDF/XML
  • Provides a solution for Object-relational impedance mismatch[3]
  • Compatibility with XML use on the data transport layer

XML-enabled databases

XML-enabled databases typically offer one or more of the following approaches to storing XML within the traditional relational structure:

  1. XML is stored into a CLOB (Character large object)
  2. XML is "shredded" into a series of tables based on a schema[4]
  3. XML is stored into a native XML Type as defined by ISO Standard 9075-14[5]

RDBMS that support the ISO XML Type are:

  1. IBM DB2 (pureXML[6])
  2. Microsoft SQL Server[7]
  3. Oracle Database[8]
  4. PostgreSQL[9]

Typically an XML-enabled database is best suited where the majority of data are non-XML. For datasets where the majority of data are XML, a native XML database is better suited.

Example of XML Type Query in IBM DB2 SQL

select
   id, vol, xmlquery('$j/name', passing journal as "j") as name 
from
   journals
where 
   xmlexists('$j[licence="CreativeCommons"]', passing journal as "j")

Native XML databases

Native XML databases are especially tailored for working with XML data. As managing XML as large strings would be inefficient, and due to the hierarchical nature of XML, custom optimized data structures are used for storage and querying. This usually increases performance both in terms of read-only queries and updates.[10] XML nodes and documents are the fundamental unit of (logical) storage, just as a relational database has fields and rows.

The standard for querying XML data per W3C recommendation is XQuery; the latest version is XQuery 3.1.[11] XQuery includes XPath as a sub-language and XML itself is a valid sub-syntax of XQuery. In addition to XPath, some XML databases support XSLT as a method of transforming documents or query results retrieved from the database.

Language features

Template:Sort-under

Name License Native Language XQuery 3.1 XQuery 3.0 XQuery 1.0 XQuery Update XQuery Full Text EXPath Extensions EXQuery Extensions XSLT 2.0 XForms 1.1 XProc 1.0
BaseX Template:Open source Java Yes Yes Yes Yes Yes Yes Yes Yes Yes No
eXist GNU LGPL Java Partial Partial Yes Proprietary Proprietary Yes Yes Yes Yes Yes
MarkLogic Server Commercial C++ No Partial Yes Proprietary Proprietary No No Yes Yes No
OpenText xDB Commercial Java Partial Partial Yes Yes Yes No No No No No
Oracle Berkeley DB XML Commercial C/C++
Qizx Commercial Java No No Yes Yes Yes No No Yes No No
Sedna Apache License 2.0 C/C++

Supported APIs

Name XQJ XML:DB RESTful RESTXQ WebDAV
BaseX Yes Yes Yes Yes Yes
eXist Yes Yes Yes Yes Yes
MarkLogic Server Yes No Yes Yes Yes
Qizx No No Yes No No
Sedna Yes Yes No No No

References

Page Template:Reflist/styles.css has no content.

  1. ^ Lua error in package.lua at line 80: module 'Module:Citation/CS1/Utilities' not found.
  2. ^ Lua error in package.lua at line 80: module 'Module:Citation/CS1/Utilities' not found.
  3. ^ [NoSQL Distilled: A Brief Guide to the Emerging World of Polyglot Persistence. Addison-Wesley Educational Publishers Inc, 2009] Template:ISBN
  4. ^ Lua error in package.lua at line 80: module 'Module:Citation/CS1/Utilities' not found.. Section Creating XMLType Tables and Columns Based on XML Schema
  5. ^ Lua error in package.lua at line 80: module 'Module:Citation/CS1/Utilities' not found.
  6. ^ Lua error in package.lua at line 80: module 'Module:Citation/CS1/Utilities' not found.
  7. ^ Lua error in package.lua at line 80: module 'Module:Citation/CS1/Utilities' not found.
  8. ^ Lua error in package.lua at line 80: module 'Module:Citation/CS1/Utilities' not found.
  9. ^ Lua error in package.lua at line 80: module 'Module:Citation/CS1/Utilities' not found.
  10. ^ Lua error in package.lua at line 80: module 'Module:Citation/CS1/Utilities' not found.
  11. ^ Lua error in package.lua at line 80: module 'Module:Citation/CS1/Utilities' not found.

Lua error in package.lua at line 80: module 'Module:Navbox/configuration' not found. Lua error in package.lua at line 80: module 'Module:Navbox/configuration' not found.