Documents
What are Documents?
The Document Store sees a document as a group of sub-documents sharing a common identifier. Each sub-document has certain meta-data associated with it, as well as a blob of bytes which contain the body of the document. A document may be in one of two states once created, mutable and immutable. Once a document is marked immutable (this is also called committing it), it cannot be altered or destroyed. The mechanism of sub-documents is intended to allow for versioning, but may be used for other purposes, such as logical grouping.
Document Structure
As stated above, documents are composed of a series of sub-documents each sharing a document identifier. Each sub-document additionally has its own identifier and a group of meta-data associated with it. It is convenient to think of a document as a molecule. The molecule is composed of several smaller sub-molecules. Each sub-molecule contains several atoms; these atoms are the data and meta-data of the sub-document.
The primary atom in the sub-document is a large group of bytes tagged with an encoding and mime-type, which contains the meat of the sub-document, the document itself. This atom is known as the body.
Secondary atoms include ownership and copyright information, search information (search terms and keywords), and card catalog information (title, author, ISBN or other identifier, abstract). These atoms are known, surprisingly enough, as atoms.
It should be noted that atoms can be changed and created at will before the document is made immutable. Other information is associated with the document that cannot be changed by the client, such as transaction histories, store information, MD5sums, and other security- and storage-related information associated with the document and sub-document.
XML Specification
The documents stored in the Document Store can be described in terms of an XML document. Each of the above elements have XML tags and attributes associated with them so that transactions with the server can be done through XML easily. XML also gives the implementor the flexibility to add custom atoms and other elements without breaking compatibility.
FIXME: include the DTD description here