Database Reference
In-Depth Information
• Version write conflict avoidance is implemented in a serialization filter written in
Java called org.exist.versioning.VersioningFilter . The use of the filter is
optional, but it potentially stops two users from editing the same document out‐
side of eXist and overwriting each other's changes.
When the VersioningTrigger is configured on a collection, it will store information
about revisions to documents within that collection hierarchy in a mirrored collec‐
tion hierarchy, under /db/system/versions . Specifically, the version trigger performs
the following operations on various document events:
• The first time a document is changed:
— Before it is changed, a copy will be made and stored into the appropriate mir‐
rored collection within /db/system/versions ; it will have the same filename as
the original but with the additional suffix .base . This is known as the docu‐
ment base revision .
— After it is changed, a document describing the differences from the document
base revision to the new revision is also stored into the appropriate mirrored
collection within /db/system/versions ; it will have the same filename as the
original but with an additional ordinal suffix indicating the revision number.
This is known as a diff document . These documents use an XML format that is
specific to eXist. For binary documents we can only say that one document
replaced another, so we also store a copy of the new binary document with the
ordinal suffix and an additional .binary suffix. For XML documents the diff
document also describes node-level insertion , deletion , and append opera‐
tions; a change is modeled as a delete and insert .
• The 1+ n time a document is changed:
— After it is changed, like the first time it is changed, a document describing the
differences from the document base revision to the new revision is again
stored into the versions collection, with an ordinal suffix (and if it is a binary
document, then that is likewise stored again with the .<ordinal>.binary suf‐
fix). Just as before, this is known as a diff document; however, it is worth not‐
ing that every diff is between the current document and its document base
revision, not the most recent revision.
Diff documents are absolute rather than incremental. The
advantage of this is that it is very simple to understand the
changes from the original document to the current docu‐
ment. The downside, however, is that diff documents
become increasingly large over time, and you have to
replay each diff independently to see the changes over
time (which repeats many operations).
Search WWH ::




Custom Search