Amazon claims that migrating from MongoDB to DocumentDB is “as easy as changing the database endpoint to the new Amazon DocumentDB cluster”.
We regularly assess DocumentDB’s compatibility claims by running 6 MongoDB test suites, totaling over 1,200 tests, against DocumentDB’s API emulation. This is the suite that we use to test MongoDB’s own conformity and correctness on every database release, and is the best representation of what the full MongoDB API is.
The tests comprise:
● jsCore: nearly 900 tests of MongoDB CRUD operations and database commands
● aggregation: nearly 250 tests of the MongoDB aggregation pipeline
● jsCore_decimal: evaluates correct behavior of applications using the decimal data type for high precision, fractional numeric data typical in financial and scientific workloads
● change_streams: tests MongoDB change streams, used by developers to build event-driven data pipelines that react in real time to database changes
● jsCore_txns: evaluates correct behavior of multi-document ACID transactions in MongoDB
● jsonSchema: tests the data governance controls provided by MongoDB
At the time of testing (November 2020), DocumentDB emulates a subset of the MongoDB 4.0 protocol. Unlike DocumentDB, MongoDB Atlas — the fully managed MongoDB service — supports the latest MongoDB 4.4 release.
63% of all of the correctness tests failed when comparing the DocumentDB API emulation to MongoDB. For developers, this means that:
Any existing MongoDB apps relying on this functionality would need to be re-engineered if they are to be migrated to DocumentDB
Any new apps written against the DocumentDB API only support a subset of MongoDB’s functionality
Any application written for DocumentDB will be locked-in to AWS.
|Number of Tests||Succeeded||Failed|
*Feature not supported by the DocumentDB API emulation
**Tests were run against the MongoDB v4.4 API. Tests of the MongoDB v4.0 API show a 60% failure rate
In terms of functionality, DocumentDB most closely resembles MongoDB 3.0/3.2, released in 2015. As a result, developers will need to either:
Reimplement required database functionality back in the application tier, slowing down the pace of application development
Move multiple copies of the data into adjacent AWS technologies, with the associated increases in development and operational costs and platform complexity
Key gaps include:
Less than 50% of MongoDB 4.0 aggregation pipeline stages and query language operators are supported. Missing functionality includes:
No schema governance to control data quality
Despite claiming support for change streams, over 80% of MongoDB’s change streams correctness tests still fail, due to DocumentDB:
DocumentDB’s multi-document ACID transactions support, added in their 4.0 update, are limited when compared to transactions in MongoDB, failing over half of the standard test suite:
In contrast, Atlas is updated as soon as each new database release is declared as Generally Available, meaning developers don’t have to wait months or years to access the latest platform enhancements. From MongoDB 5.0 onwards, Atlas will be updated even more frequently with new GA releases available every quarter, leaving DocumentDB even further behind. The upcoming MongoDB 5.0 release is scheduled to offer the Versioned API, which allows users to pin their application to a specific version of the MongoDB API with the confidence that their code will continue to run for years, without interruption, even as the database is upgraded beneath it. The Versioned API will provide you with a level of investment protection and API stability that is simply not possible with most other databases, including DocumentDB.
The service is backed by thousands of support engineers, consultants, and solutions architects from MongoDB and the partner ecosystem who offer the benefits of collective MongoDB knowledge acquired supporting tens of thousands of MongoDB customers over the past decade.
The development, release, and timing of any features or functionality described for our products remains at our 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.