MMS • RSS
Undoubtedly, the major feature of this announcement is the support for multi-document ACID transactions. Taking a big step towards converging with relational database products, MongoDB supports the concept of session which database operations can reference and use the supporting methods start_transaction() and commit_transaction() to wrap multiple database commands into a single MongoDB transaction.
MongoDB’s transactions follow the well known ACID model. Atomicity makes sure that the set of commands that belong to a transaction will either be fully completed or not at all. There will never be any leftover or partial data. Consistency refers to the property that the database will always be transitioning from one valid state to the next valid state, never being left in an invalid state. Isolation guarantees that multiple transactions can execute at the same time, without any one of them being able to view partial results of the others. Executing multiple transactions at the same time has the same end result as executing them sequentially. Durability guarantees that a transaction that has committed will remain persistent, even in the case of a system failure.
MongoDB’s multi document transactions are only available for servers using the WiredTiger storage engine and currently restricted to a single replica set, with support for sharded clusters coming up in version 4.2.
Multi document transactions come with some limitations such as not being able to affect the database catalog (i.e. affect or list indexes and collections) and not being able to issue commands that fall outside the CRUD and information listing space.
These transactions can only use readPreference primary and readConcern snapshot, local or majority. Read preference inside a transaction overrides any read preference set in collection, database and client level.
Query cursors are isolated in a transaction, meaning for example that a getMore operation inside a transaction can only be used inside and then an outside one, only outside of the transaction. MongoDB has published an extensive list of commands limitations and support regarding transactions.
Version 4.0 of MongoDB introduces type conversions between double, string, objectId, boolean, date, integer, long and decimal types using the aggregation pipeline. This allows for enhanced data transformation in-database and less reliance on ETL processes.
Also announced in beta, the MongoDB Enterprise Kubernetes Operator which allows deploying MongoDB in a Kubernetes cluster while leveraging the capabilities of MongoDB Ops Manager. Developers can either download the new version or try it online using the MongoDB Atlas service.