|MongoDB 4 Released|
|Written by Kay Ewbank|
|Tuesday, 24 July 2018|
MongoDB 4 has been released with support for multi-document ACID transactions. The popular document database had some support for ACID transactions at the document level in earlier versions, but until now not for multi-document transactions.
The multi-document transaction support provides a globally consistent view of data, with multi-statement transactions that use start_transaction and commit_transaction statements. In this release, the multi-document transactions work across a single replica set. MongoDB 4.2 will add support for transactions across a sharded deployment.
The transactional support comes courtesy of a major re-engineering of MongoDB to make use of the WiredTiger storage engine that MongoDB acquired three years ago.
Making multi-document transactions work correctly means having consistent rules for how to decide which changes to keep when multiple versions exist. Currently, the transactions use a read concern snapshot. This means that if the transaction is not part of a causally consistent session, when the transaction commit uses a majority write concern, the transaction operations are guaranteed to have read from a snapshot of majority-committed data. A write concern describes the level of acknowledgement requested from MongoDB for write operations to a data set. A majority write concern means that MongoDB has received acknowledgement that write operations have propagated to the majority of voting nodes, including the primary. This all means that you get causal consistency with the operation immediately preceding the transaction start. As a result, a consistent view of the data is returned to the client, irrespective of whether that data is being simultaneously modified by concurrent operations.
Alongside the release of MongoDB 4, the company also announced the general availability of MongoDB Stitch, a serverless platform designed for developing mobile and web applications. Stitch aims to combine access to database functionality alongside robust security and privacy controls. It includes Stitch QueryAnywhere, a service that exposes MongoDB's document model and query language via a rules engine that lets you define fine-grained security policies.
Alongside these releases, the company announced a public beta of MongoDB Charts, which can be used to create and share visualizations of MongoDB data, using a document-native interface.