The XML Store consists of various layers, each responsible for a specific set of tasks:
The figure shows an application utilising the XML Store. There are three main components, namely Application, XML Store and Name Service. The XML Store component provides an API for processing and manipulating XML documents, and offers storage and retrieval of these documents as well. When storing a given document the XML Store returns a value reference referring to the document. This reference can either be stored locally by the application or be associated with a symbolic name using the Name Service. Other applications interested in the document can obtain the value reference for a document from the Name Service.
The XML Layer models XML documents as an object structure, allowing the programmer to work with an abstract representation of the document instead of a flat, sequential text file. The API allows traversal of documents and various methods for modifying the document, e.g. removing an element, adding an element, replacing an element etc. The API is value-oriented, so all modifications to a document will result in a new document containing the changes, with the old document still intact. It also lets the programmer externalise the document to the typical flat text file format, to facilitate communication with systems that expect this format.
The XML Storage Layer implements the storage strategy. It is responsible for converting documents from the XML layer to sequences of bytes that the underlying Distributed Storage layer can understand. The layer converts each node in an XML document to a byte sequence, and stores the node. When storing a document a value reference to the document is returned to the application. A document can only be loaded if you know its value reference.
The Distributed Storage Layer is a peer-to-peer system based on the Chord protocol. It can be regarded as a distributed hash table that allows storing and retrieval of values as sequences of bytes associated with a (hash) key in the form of a value reference. The peer (machine), on which the value is actually stored, is not known by higher layers. When the Distributed Storage layer has located the peer responsible for storing a particular value, it stores the value on that peer using the Disk Layer. The Disk layer simply persists <byte sequence, value reference> pairs to the local file system for permanent storage.
The Name Service is a simple service mapping symbolic names to value references. It is completely separate from the XML store, as the XML Store only knows of values and value references and not of any symbolic names.
Symbolic names can be updated to point to new value references, as it is necessary to have some mechanism for publishing the current version of some document. To reflect updates we need some way of accessing public and updateable names for the documents that are published.