Database documents are stored in memory-mapped files. Per default, these memory-mapped files are synced regularly but not instantly. This is often a good tradeoff between storage performance and durability. If this level of durabiity is too low for an application, the server can also sync all modifications to disk instantly. This will give full durability but will come with a performance penalty as each data modification will trigger a sync I/O operation.
Instead of overwriting existing documents, a completely new version of the document is generated. The two benefits are:
The system collects obsolete versions as garbage, recognizing them as forsaken. Garbage collection is asynchronous and runs parallel to other processes.
There are certain default values, which you can store in the configuration file or supply on the command line.
--database.maximal-journal-size size
The default is 32MB
.
--database.force-sync-shapes boolean
true
. If turned on, syncing of shape data will always happen, regards of the value of waitForSync.
The default is true
.
You can configure the durability behavior on a per collection basis. Use the ArangoDB shell to change these properties.
collection.properties()
waitForSync
: If true
creating a document will only return after the data was synced to disk.journalSize
: The size of the journal in bytes.collection.properties(properties)
waitForSync
: If true
creating a document will only return after the data was synced to disk.journalSize
: The size of the journal in bytes.Note that it is not possible to change the journal size after the journal or datafile has been created. Changing this parameter will only effect newly created journals. Also note that you cannot lower the journal size to less then size of the largest document already stored in the collection.
Examples
Read all properties
arango> db.examples.properties() { "waitForSync" : false, "journalSize" : 33554432 }
Change a property
arango> db.examples.properties({ waitForSync : false }) { "waitForSync" : false, "journalSize" : 33554432 }