A detailed explanation of some confusing concepts in XML database

Source: Internet
Author: User
Tags object definition object model xpath xslt processor
xml| Concept | data | Database when developers talk about XML databases, they tend to refer to two concepts: databases that store XML data, and DBMS using XML databases. Most major DBMS products allow you to integrate XML data into your program without changing the existing database. Now let's discuss the XML database and explore its features.

  the original XML database

An original XML database (NXD) can be very simple, or it can be very complex. I do this by defining the concept of a database: A collection of permanent stable data. Under such a definition, a nxd can logically store an XML document. When Xml:dbinitiative has more requirements for a nxd, I think the above definition can be met.

The following lines of code can be used as a 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, the collection of data is stored in XML format. If it is stored in a flat file, it will also satisfy our definition of NXD: A collection of permanent stable data.

A nxd uses the same way to store XML documents (such as: flat files, relational databases or level databases, object databases).

  Flat File

A simple flat file is one of the simplest XML database models. As a "variant", you can store a lot of XML documents at a directory level. To extend the previous example, look at the following models:


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

 relational database

The XML database in a relational database can be divided into three models: coarse-grained (coarse texture), medium-grained (medium-level texture), or fine-grained (fine texture).

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

    Create table Diets (dietname varchar2 (), XmlDocument varchar2 (32000))

The fine-grained (fine texture) model maps each component of an XML document to a relational database. In order to be able to transfer the flat model to a relational database, you must use two different ways. For the above example, you can no longer use the subdirectory name to represent the name of diet, and you can no longer use the name of the file to pass the diet date. Table A shows the file type definition (DTD) for the Diet XML document, 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 (coarse texture) model and the fine-grained (fine texture) model. Using this model, you can store the information in the Xml_items column of the meals table.

  Object Database

You can also perform nxd by using an object database. Some object databases are based on the Document Object Model (DOM), which allows the XML to be tightly bound to the database. For example, once you provide a food DTD, you can start saving the food without the need for additional configuration.

  Database management System

You can have a variety of options for your DBMS. You can build your own DBMS by using open programs such as exist or ozone, or buy a commercial product such as a Tamino XML Server.

Most relational database vendors make their databases able to use XML, at least, and XML databases (XEDBS) can return the results of XML document queries. Many others can also save XML data. For example, Oracle provides an XML profiler, an XPath engine, an XSLT processor, a xmlsql tool, and a way to use XML.

So what's the difference between using nxd stored in relational databases and xedb storing XML data? A nxd is based on the concept of an XML document, and Xedb is not too much associated with others. Also, many specifications apply to NXD, and the DBMS only applies to standard queries and XML documents that store data, such as XPath.

  XML database is not a new concept

The XML database is not a new concept on the logical point of view, although it is new in logic execution. If you want to execute an XML database, you can use Nxd,xedb or a combination of the two. However, if your company already has a certain amount of investment in the existing database, your first survey will be to verify that your dmbs vendor provides tools to use XML. No matter what kind of XML database you use, you have to understand the characteristics of each database, which is the most important.

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.