A Document is a single piece of stored data. Each document is stored within a
Collection, and has a unique ID within that Collection. A Document also contains a revision ID as well as a digest matching the current contents of the document.
When a Document is updated, PliantDb will check that the revision information passed matches the currently stored information. If not, a conflict error will be returned. This simple check ensures that if two writers try to update the document simultaneously, one will succeed and the other will receive an error.
PliantDb provides APIs for storing serde-compatible data structures using the CBOR format. CBOR provides larger data type compatibility than JSON, and is a more efficent format. It also provides a bit more resilliance for parsing structures that have changed than some other encoding formats, but care still needs to be taken when updating structures that represent already-stored data.
If you would prefer to manually manage the data stored inside of a Document, you can directly manage the
contents field. PliantDb will not interact with the
contents of a Document. Only code that you write will parse or update the stored data.