Durability
On commit, all modifications done in the transaction will be written to the collection datafiles. These writes will be synchronized to disk if any of themodified collections has the waitForSync property set to true, or if anyindividual operation in the transaction was executed with the waitForSync attribute. Additionally, transactions that modify data in more than one collection areautomatically synchronized to disk. This synchronization is done to not onlyensure durability, but to also ensure consistency in case of a server crash.
That means if you only modify data in a single collection, and that collection has its waitForSync property set to false, the whole transaction will not be synchronized to disk instantly, but with a small delay.
To ensure durability of transactions on a collection that have the waitForSync_property set to _false, you can set the waitForSync attribute of the objectthat is passed to executeTransaction. This will force a synchronization of thetransaction to disk even for collections that have waitForSync set to false:
An alternative is to perform an operation with an explicit sync request ina transaction, e.g.
In any case, ArangoDB will give users the choice of whether or not they want full durability for single collection transactions. Using the delayed synchronization(i.e. waitForSync with a value of false) will potentially increase throughput and performance of transactions, but will introduce the risk of losing the lastcommitted transactions in the case of a crash.
In contrast, transactions that modify data in more than one collection are automatically synchronized to disk. This comes at the cost of several disk sync.For a multi-collection transaction, the call to the _executeTransaction function will only return after the data of all modified collections has been synchronized to disk and the transaction has been made fully durable. This not only reduces therisk of losing data in case of a crash but also ensures consistency after arestart.
For multi-collection transactions, there will be at least one disk sync operation per modified collection. Multi-collection transactions thus have a potentially highercost than single collection transactions. There is no configuration to turn off disk synchronization for multi-collection transactions in ArangoDB. The disk sync speed of the system will thus be the most important factor for the performance of multi-collection transactions.