Store a large number of XML documents in relational databases

Source: Internet
Author: User
    
When saving XML documents in relational databases, you must have encountered many problems due to method reasons, especially for a large number of documents. This article will introduce specific problems related to a large number of XML documents and provide solutions to these problems.
Potential problems with a large number of documents
What makes an XML document very huge? One of the major signs of an XML document is that it encountered problems when it was started. Now let's discuss the potential issues.
The first is about raw space. The problem is related to the frequency and space. It is not that your documents are larger than the normal state, but that you use them frequently. You must have a good size data partition to store these documents (or databases ).
Second, running the database may produce errors. Sometimes XML documents are divided into multiple parts and stored in discontinuous tables that represent the structure of XML documents. However, XML documents are usually stored in BLOB, text, or VARCHAR fields.
In addition to the lack of design, you may encounter problems on the interface for communicating with the database. For example, the vast majority of SQL executions limit data to 4,096 bytes-this means that when SQL is used to send 10 KB documents to the database, you will be blocked. Similar restrictions also exist in database storage programs. If you are not aware of these limitations and your documents are out of scope, you will encounter these problems.
Database Design
Developers and database administrators must have a clear understanding of the operations to be performed in the XML document so that they can correctly design the database. Understanding how databases will be used is equally important. Is your XML document a simple continuous storage mechanism? Or is it stored in a non-continuous state?
If you store the entire document in a whole block, you have multiple options. For non-continuous data, you should design a table that represents the XML structure and store the data separately in an independent table. The second step has the advantages of being indexable and queryable, and you do not need to perform operations on the entire document.
BLOB (binary large object) is used to store large binary data. For example, encrypted files are often used in BLOB fields. BLOB is very suitable for storing XML files. The disadvantage of the BLOB field is that it is not indexable and queryable, and it cannot exchange a large amount of data with BLOB through standard SQL.

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.