BlogRun AI wherever your compliance framework demands. Read blog >
BlogRetrieval accuracy is now a competitive advantage Read blog >

Comparing Amazon DocumentDB and MongoDB

Start Free

Table of Contents:

There may seem to be multiple options for deploying MongoDB in the cloud. Amazon DocumentDB, for example, claims to be an AWS-native database with full support for the MongoDB API. While this managed solution supports some MongoDB features, it is important to note that DocumentDB is not fully compatible. The only place to access fully featured MongoDB as a service on AWS is through MongoDB Atlas.

In this comparison, we’ll explain the differences between Amazon DocumentDB and MongoDB Atlas, focusing on the following key areas:

  • Compatibility: Amazon claims that migrating an application from MongoDB to DocumentDB is “as easy as changing the database endpoint to the new Amazon DocumentDB cluster”. We have debunked this by running a suite of compatibility tests that show DocumentDB is not fully compatible with the features and functionality available in MongoDB Atlas.
  • Architecture: Amazon DocumentDB is built on top of a different platform than MongoDB, behaving more like a modern relational database. This has implications on scalability and the potential for adding more native MongoDB features in the future. DocumentDB can be deployed using elastic clusters, which impose additional operational constraints.
  • Deployment: Amazon's DocumentDB relies on proprietary technology, and there is no way to run the database outside of AWS. Unlike MongoDB Atlas, which supports connections via a public endpoint, Amazon DocumentDB must be deployed within a virtual private cloud (VPC) to connect and operate.
  • Developer productivity: Amazon DocumentDB lacks native integration with features or tools to support time series, search, and analytical use cases. Users must take on the operational burden of moving data out of DocumentDB and into other services in order to access features to support those workloads.
  • Operational maturity: Database management and maintenance in Amazon DocumentDB is held back by limited tooling, a complex upgrade process, few backup options, and gaps in security features.

What is DocumentDB?

Amazon DocumentDB is a NoSQL JSON document database service with a limited degree of compatibility with MongoDB.

DocumentDB is not based on the MongoDB server. Rather it emulates the MongoDB API, and runs on top of a different platform. This creates significant architectural constraints, functionality limitations, and frequent incompatibility.

Interested in up-to-date results on DocumentDB's compatibility with the MongoDB API? Get the latest results at Is DocumentDB Really MongoDB?

The key differences between DocumentDB and MongoDB’s on-demand, elastic, and fully managed Atlas service are summarized below.

 

FeatureAmazon DocumentDBMongoDB Atlas
Fully compatible with MongoDB No, incomplete. The imitation API fails more than half of the correctness tests. Yes
Support for the latest MongoDB version at release NoYes
Scale writes and partition data beyond a single node (sharding support) Limited—hash-sharding is available, only within an elastic cluster. Sharding is not supported in other DocumentDB deployments. Yes—full support for multiple sharding methodologies, including hash, range, and geo-zone.
Replicate and scale beyond a single region / comply with data locality regulations and survive regional outages Limited—supports only a few secondary regions with read-only clusters consisting of a modest number of replica instances. Yes—global clusters with up to 50 replicas per shard across multiple regions.
High resilience, rapid failure recovery, fast failover, retryable writes, multi-region No—~30-second failover, no retryable writes, and no multi-region support within a single or elastic cluster. Yes
Multi-statement distributed ACID transactions Limited—ambiguous commits, poor error handling, small data sizes; transactions are not supported across shards in elastic clusters. Yes
Integrated text search, geospatial processing, graph traversals Limited—basic functionality for text search and geospatial operators. Yes—all available from a single API and platform.
Native support for time series data NoYes
Hedged Reads—Queries submitted to multiple replicas for consistent low latency NoYes
Online archive (automatically tier data out to cloud object storage, Amazon S3) NoYes
Federated queries (integrated querying of data in the database and cold storage) No—data must be replicated to multiple adjacent AWS services, increasing cost and complexity. Yes—Atlas Data Federation, compatible with AWS S3, Azure Blob Storage, and Google Cloud.
Advanced aggregation features (on-demand materialized views, $merge aggregation stage) NoYes
Schema governance Limited—$jsonSchema is supported, but there are no bypass options. Yes—supports JSON schema.
Rich data types Limited—supports decimal128 values, but lacks advanced aggregation features for them. Yes
Reactive, event-driven data pipelines Limited—change streams run against the primary only and incur additional cost. Yes—supports MongoDB Change Streams and Atlas Triggers.
Role-based access control and authentication restrictions Limited—offers only coarse-grained roles. Yes
Fine-grained monitoring telemetry & prescriptive performance recommendations No—provides fewer than 50 metrics. Yes—over 100 metrics with Performance Advisor for index and schema recommendations.
Client-side field level encryption for fine-grained separation of duties in the cloud Limited—only supports point equality queries. No support for automatic encryption. Yes
Queryable Encryption NoYes
Availability of advanced developer and analysis tools Limited Yes—includes MongoDB Compass, Charts, SQL Connector, Tableau Connector, Power BI Connector, and Spark Connector.
Freedom from vendor lock-in No—available on AWS only. Yes—available on AWS, Azure, and Google Cloud, with a presence in 125+ regions.
Develop & run anywhere No—available on AWS only. Yes
Access to MongoDB expertise NoYes
Stream processing NoYes

 

What is MongoDB Atlas?

MongoDB Atlas is a fully managed, on-demand, and global service in the public cloud. Atlas enables customers to deploy, operate, and scale MongoDB databases on and across multiple clouds—AWS, Azure, and Google Cloud. MongoDB Atlas is available through a pay-as-you-go model and billed on an hourly basis. It's easy to get started—use a simple GUI or programmatic API calls to select the public cloud provider, region, instance size, and features you need. MongoDB Atlas provides:

MongoDB Atlas is serving a vast range of workloads for startups, Fortune 500 companies, and government agencies, including mission-critical applications handling highly sensitive data in regulated industries. The developer experience across MongoDB Atlas and self-managed MongoDB is consistent, ensuring that you easily move from on-premises to the public cloud, and between providers as your needs evolve.

Built and run by developers, MongoDB Atlas is the best way to run MongoDB apps.

Is Amazon DocumentDB Compatible with MongoDB?

Amazon DocumentDB claims to support the MongoDB 8.0 API, which implies that it is at parity with MongoDB v8.0, released in October 2024. However, this is only partially true, as Amazon DocumentDB does not support the majority of MongoDB v8.0 differentiating features. Applications written for MongoDB will need to be rewritten to work with Amazon DocumentDB. However, since DocumentDB emulates a MongoDB API, applications written for DocumentDB can be easily migrated into MongoDB Atlas.

Additional Resources

Interested in migrating from DocumentDB to MongoDB Atlas? Please refer to our migration guide.

Interested in up-to-date results on DocumentDB's compatibility with the MongoDB API? Get the latest results at Is DocumentDB Really MongoDB?

Try MongoDB Atlas for free for a real MongoDB experience.

FAQs

Get started with Atlas today

Get started in seconds. Our free clusters come with 512 MB of storage so you can play around with sample data and get oriented with our platform.
Try FreeContact sales
GET STARTED WITH:
  • 125+ regions worldwide
  • Sample data sets
  • Always-on authentication
  • End-to-end encryption
  • Command line tools