SOURCE XML Database Xindice Introduction (1.0 Edition)
Source: Internet
Author: User
xml| Data | Database (Xindice current version is 1.1B4, has made a big change, this article is the 1.0 version of the description document translation, for reference only. Some of the changes are described briefly in the text.
———— Translator: ksu99)
What is Xindice
The Xindice core server is a completely database server designed to store XML data. In terms of terminology, the Xindice server is the so-called native XML Database (NXD). It can also be said to be a seamless XML database, such a description may be easy to understand some.
This means that using this server, you can use XML tools and techniques to the maximum possible. All data that goes into and out of the server is XML. The query language used is XPath, and the programming API supports DOM and sax. All of this should be familiar to a developer who has used XML in their applications. When dealing with XML data and Xindice, there is no mapping between different data schemas. You just need to simply design the data in XML to store it in XML.
All that is given to you can be summed up in one word: flexibility. XML provides an extremely flexible mechanism for modeling application data and, in many cases, allows you to build model constructs that are difficult to build or even impossible to build in most traditional systems. This is the semi-structured model, which is the basic artifact in some applications. By using a source XML database like Xindice (NXD) to store semi-structured data, you can focus on building applications without worrying about how complex XML structures map to underlying data stores, or trying to enforce a flexible data model with a rigorous set of schemas.
Ultimately, Xindice is a tool. It is appropriate for some jobs and completely wrong for others. The only thing it's good at is storing XML data. In fact, that's all. If you have a lot of XML data, then Xindice may just be the tool you need. However, if your data is not XML or you need to accurately control the structure of the data, you might want to use a different database solution.
(Note: In version 1.1, server-side installations are now deploying a war file within the Java servlet Engine (TOMCAT).) The database is deployed within a servlet engine and allows network access. This is different from version 1.0 because version 1.0 has its own server framework. This is done because the original server framework repeats many of the functionality of the servlet engine and makes deployment options more flexible when separated. )
Current state
Native XML database technology is a very new field, and Xindice is more of a project still in development. The server currently supports storage of well-formed (well formed) XML documents. This means that there is no pattern to constrain a document that can be put into a collection of documents. This makes Xindice a semi-structured database and provides great flexibility in how to store data, but it also means discarding some common database features, such as data types. [1] In the current state, Xindice is already a powerful tool for managing XML data. But there's a lot more to be done.
This article attempts to describe the features that are currently working and can be used. Please check the Readme document, which contains a lot of information about the current state of the project.
Note: The Xindice server and this document are in the process of being improved. Welcome and encourage any comments.
Attribute Summary
Document collections (document Collections): Documents are stored in a collection that can be queried as a whole. You can create a collection that contains only the same type of document, or you can create a collection to store all the documents. Database doesn't mind.
XPath query engine: To query the collection of documents, you can use the XPath defined by the consortium. This provides a fairly flexible mechanism for querying documents by locating and restricting the return of the result tree.
XML indexes: To improve the performance of queries on a large number of documents, you can define indexes on element and attribute values. This can greatly accelerate the query response time.
Xml:db xupdate implementation: When storing XML to a database, you may need to be able to change the data without retrieving the entire document. Xupdate is the mechanism used when you need to do server-side data updates. This is an xml-based language that determines XML modifications and allows them to be applied to the entire collection of documents as if they were applied to a single document.
Java XML:DB API implementation: Provides a XML:DB API implementation for Java programmer Xindice. This API will bring portability to XML database applications, just as JDBC is relative to relational databases. Most applications developed for Xindice will use the Xml:db API. (Translator note: In version 1.1, there is an embedded version of the xml:db API that can access database widget Xindice applications without using a network.) This is fully compatible with the XML:DB API that enables the network. )
Xmlobjects:xmlobject provides a server extension mechanism to add additional functionality to the server. They can be used to perform complex operations within the database engine to reduce network bandwidth or to increase functionality not available on the current server. (Translator Note: Version 1.1 of xmlobjects has been deleted.) )
Command-Line administration tool: To help system administrators, Xindice provides a full set of command-line-driven management tools. All the things you can do with the Xml:db API can also be done from the command line. (Translator Note: The Xindiceadmin tool has been removed.) Commands previously accessible only through Xindiceadmin are now completed by the Xindice command. This makes the server operation simpler. The command-line tool adds an option to allow XPath queries to use the namespace (namespaces) specification. )
CORBA Network API: For developers who are happy to use the Java language, Xindice provides a CORBA API that can be used to build applications. All the features available through the XML:DB API can be implemented through the CORBA API. In fact, the XML:DB API is built on the CORBA API. Although most Java developers will never need to know the existence of CORBA APIs. (Translator note: In version 1.1, the network access API is based on XML-RPC rather than CORBA.) All CORBA-related code has been removed from the system. The system now fully supports UTF-8 encoding. )
Module Architecture: The Xindice server is structured in a very modular way. This makes it easy to add and subtract components to crop the server, make it a special working platform, or embed it in another application.
Database structure
The Xindice server is designed to store the collection of XML documents. Collections can be arranged in a hierarchical structure, similar to typical UNIX or Windows file systems.
In Xindice, the data store is based on a database instance that can also be used as a collection of documents. This database instance can contain any number of subset fits. In the default installation of Xindice, this database instance is called "db" and all the collection paths start with/db. It is also possible to rename this database instance, although it is not necessary to do so.
A reference collection (collections) is the same as a reference to a hierarchical file system.
1.1. Collection Path Instance
If you create a collection named My-collection under "DB" with a collection named My-child-collection, the path to the My-child-collection collection will be:
/db/my-collection/my-child-collection
You can store several types of objects within a collection. You can store XML documents, Xmlobject, and other collections. These objects can also be referenced by path respectively.
1.2. The collection path Specifies a document
To extend the previous example, add a document named My-document in My-child-collection that can be referenced by the following path:
/db/my-collection/my-child-collection/my-document
However, this path can only get one. Because you might have more than one object with the same name in a collection [2], there is a priority order problem when calculating a path. Precedence is the collection, xmlobject, and documentation in turn. This means that if you have a document and a set of contract names, you will not be able to retrieve the document. [3]
You can also access the collection on the remote computer by specifying the host and server port numbers.
1.3. The collection path specifies a remote document
If the previous example is on a remote computer, the path will look like this:
[1] XML Schema support will be added in later versions of Xindice. Mode is always optional, but it can be used to force a collection to store specific document types and allow data types to support
[2] For example, a child collection and a document
[3] This constraint will be adjusted after the Xindice version
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