Announcing the MongoDB Distributed Transactions Beta Program
March 14, 2019 | Updated: February 22, 2021
It was just over 12 months ago that we announced we were bringing multi-document ACID transactions to MongoDB. We shipped the first beta code a couple of weeks later, and then after several thousand of you put transactions through their paces, went to General Availability (GA) as a part of the MongoDB 4.0 release in June 2018.
We're now really excited to announce the next phase of this development with the introduction of Distributed Transactions, extending our multi-document ACID guarantees from replica sets to sharded clusters. As a result, it will now be even easier for you to address a complete range of use cases by enforcing transactional guarantees across high scale, globally distributed apps.
We plan to ship Distributed Transactions with MongoDB 4.2 later this year* and want to get them into your hands as soon as possible. So we are kicking off the beta program today, and invite you all to sign up and take them for a spin.
What do they look like?
Distributed transactions adhere to our original design goals – they feel just like the transactions you grew up with in relational databases. They have a similar syntax, are multi-statement, and enforce snapshot isolation, making them familiar to anyone with prior transaction experience. If you've already used transactions in MongoDB 4.0, there is no difference using Distributed Transactions in 4.2 – the implementation is consistent whether you are executing transactions across documents, collections, and databases in a replica set, or across a sharded cluster. Review the distributed transactions documentation to learn more.
What else is coming?
Beyond support for sharded clusters, there are a few other things transactions in 4.2 will bring. These won't all be in the initial beta release, but we do plan on regular code drops through to the release candidate and GA phases:
- Large transactions: By representing transactions across multiple oplog entries, you will be able to write more than 16MB of data in a single ACID transaction (subject to the existing 60-second default maximum execution time), further simplifying application development.
- Rich transactions diagnostics: Transactions metrics will be written to system logs to expose telemetry on execution time, locks, numbers of documents touched, and more, helping you optimize application performance.
- Transaction error handling: New driver-side helpers will make it easier for you to develop retry logic in your app
- Mutable Shard Key Values: There are times when you need to move a document to a new shard. For example, you might bring a new geographic region online to better serve local users, or relocate a document to an alternative storage tier based on aging policies. With 4.2, you will be able to update one or more shard key values to modify the placement of a document in a cluster using a single, all-or-nothing ACID transaction (subject to the existing 60 second default execution time).
Hopefully, we've given you a taste for what's coming, so sign up for the Distributed Transactions beta program. From there we will provide you with further instructions on participation, where to get the code, best practices, and a forum for Q&A.
We can't wait to see what you are going to build!
The development, release, and timing of any features or functionality described for MongoDB products remains at MongoDB's sole discretion. This information is merely intended to outline our general product direction and it should not be relied on in making a purchasing decision nor is this a commitment, promise or legal obligation to deliver any material, code, or functionality. Except as required by law, we undertake no obligation to update any forward-looking statements to reflect events or circumstances after the date of such statements.