Amazon DocumentDB (with MongoDB compatibility) adds support for MongoDB 4.0 and transactions

Posted on: Nov 9, 2020

Amazon DocumentDB (with MongoDB compatibility) is a fast, scalable, highly available, and fully managed document database service that supports MongoDB workloads. Amazon DocumentDB makes it easy and intuitive to store, query, and index JSON data.

Amazon DocumentDB continues to increase compatibility with MongoDB and today added support for MongoDB 4.0 compatibility including ACID transactions. With support for MongoDB 4.0 compatibility, you can now migrate MongoDB 4.0 workloads to Amazon DocumentDB and use the same applications, drivers, and tools you already use today with your MongoDB 4.0 database with little or no change.

The following are some of the major features and capabilities that were introduced in Amazon DocumentDB 4.0:

  • ACID Transactions – Amazon DocumentDB now supports the ability to perform transactions across multiple documents, statements, collections, and databases. Transactions simplify application development by enabling you to perform ACID operations across one or more documents within an Amazon DocumentDB cluster.
  • Change streams – You can now open a change stream at the cluster level (client.watch() or mongo.watch()) and the database level (db.watch()). You can also specify a startAtOperationTime to open a change stream cursor, and extend your change stream retention period to 7 days (previously, the limit was 24 hours).
  • AWS DMS – You can now use AWS Database Migration Service (AWS DMS) to migrate your MongoDB 4.0 workloads to Amazon DocumentDB. AWS DMS now supports a MongoDB 4.0 source, Amazon DocumentDB 4.0 target, and an Amazon DocumentDB 3.6 source for performing upgrades between Amazon DocumentDB 3.6 and 4.0.
  • Monitoring – With the addition of transactions, you can now monitor your transaction usage with five new Amazon CloudWatch metrics: TransactionsOpen, TransactionsOpenMax, TransactionsAborted, TransactionsStarted, and TransactionsCommitted, in addition to new fields in currentOp, ServerStatus, and profiler.
  • Performance and indexing – Included in this release are multiple performance and indexing improvements: the ability to use an index with the $lookup aggregation stage, find() queries with projections can be served direction from an index (covered query), the ability to use hint() with the findAndModify API, performance optimizations for $addToSet operator, and improvements to reduce overall index sizes.
  • Operators – We have added support for new aggregation operators: $ifNull, $replaceRoot, $setIsSubset, $setInstersection, $setUnion, and $setEquals. 
  • Role based access control (RBAC) – With the ListCollection and ListDatabase commands, you can now optionally use the authorizedCollections and authorizedDatabases parameters to allow users to list the collections and databases that they have permission to access without requiring the listCollections and listDatabase roles, respectively. Users can also end their own cursors without requiring the KillCursor role.

For more information on Amazon DocumentDB 4.0 and transactions, please see Introducing MongoDB 4.0 compatibility and Transactions in Amazon DocumentDB.

To learn more about Amazon DocumentDB see the product page and documentation. To get started with Amazon DocumentDB, see the following tutorial.