Several confusing concepts in XML databases

Source: Internet
Author: User
Tags xml parser xslt processor

When talking about XML databases, developers often refer to two concepts: databases that store XML data, and DBMS of XML databases. The vast majority of major DBMS products allow you to integrate XML dataProgram. Now let's discuss the XML database and its features.

Original XML Database

An original XML database (NXD) can be very simple or complex. In this way, I define the concept of a Database: a set of permanent and stable data. Under such a definition, an NXD can logically store an XML document. When XML: DB initiative has more requirements on a NXD, I think the above definition can also be met.

The followingCodeThe row can be used as an NXD:

<〈? XML version = "1.0 "? > 〉
<Diet> 〉
<Meal mealname = "Breakfast"> "〉
<Item itemname = "toast" unit = "slice" quantity = "2"/> "/〉
<Item itemname = "bacon" unit = "Strip" quantity = "2"/> "/〉
</Meal> 〉
</Diet> 〉

Obviously, data sets are stored in XML format. If it is stored in a flat file, it also satisfies our definition of NXD: a set of permanent and stable data.

An NXD uses the same method to store XML documents (such as flat files, relational databases, level databases, and object databases ).

Flat file

A simple flat file is the simplest XML database model. As a "Variant", you can store many XML documents at a directory level. To expand the previous example, let's look at the following model:

Diets \
Diets \ Atkins
Day1.xml
Day2.xml
Day3.xml
Day4.xml
Diets \ 3 daydiet
Day1.xml
Day2.xml
Day3.xml

The diets directory contains subdirectories, and each subdirectory contains many XML flat files.

Relational Database

XML databases in relational databases can be divided into three models: coarse-grained (rough texture type), medium-grained (medium-level Texture type), or fine-grained (excellent Texture type ).

The coarse-grained (rough texture) model is logically different from the flat file model. You can use a relational database to store every XML document. For example, the following code can store an XML document:

Create Table diets
(Dietname varchar2 (30 ),
Xmldocument varchar2 (32000)
)

The fine-grained (fine-grained) model maps each component of an XML document to a relational database. To transfer the flat model to a relational database, you must use either of the following methods. For the preceding example, you cannot use a subdirectory name to represent the diet name, nor can you use the file name to pass the diet date. Table A displays the file type definition (DTD) of the XML document of diet, and Table B shows the Data Definition Language (DDL) that maps the DTD to the relational table ). In addition, table C also includes the corresponding XML syntax.

The Medium-grained (medium-level texture) model is between the coarse-grained (rough texture) model and the fine-grained (fine texture) model. With this model, you can store information in the xml_items column of the meals table.

Object Database

You can also use an object database to execute NXD. Some object databases are based on the Document Object Model (DOM), which allows XML to be closely integrated with databases. For example, once you provide a food DTD, you can start to save the food without additional configuration.

Database Management System

You can have multiple options for DBMS. You can create your own DBMS by using open programs such as exist or ozone, or purchase commercial products such as Tamino XML server.

Most relational database vendors enable their databases to use XML, at least XML databases (xedbs) to return XML document query results. In addition, many XML data can be stored. For example, Oracle provides an XML parser, an XPATH engine, An XSLT processor, an xmlsql tool, and an XML method.

So what is the difference between NXD stored in relational databases and xedb storing XML data? An NXD is created based on the XML document concept, and xedb is not associated with others too much. In addition, many specifications apply to NXD, while DBMS only applies to standard XML documents that query and store data, such as XPath.

XML database is not a new concept

In terms of logic, XML databases are not a new concept, although they are new in logic execution. If you want to execute an XML database, you can use NXD, xedb, or the combination of the two. However, if your company has made some investment in the existing database, your first investigation is to check whether your dmbs vendor provides the XML tool. No matter which XML database method you use, you must fully understand the features of each database. This is the most important thing.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.