NewModernize 2-3x faster with MongoDB’s AI-powered Application Modernization Platform. Learn more >
NewSearch & Vector Search now in public preview for Community Edition Read the blog >
BlogInnovate for the AI Era: Get the latest MongoDB.local NYC 2025 news and updates! Read the blog >

Comparing Amazon DocumentDB and MongoDB

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: 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 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.

Amazon DocumentDBMongoDB Atlas
Fully compatible with MongoDB

No, incomplete.

Imitation API fails 43% of correctness tests.

Support for latest MongoDB versionNo
Scale writes and partition data beyond a single node / sharding supportLimited—sharding is available within an elastic cluster deployment using only hash-sharding, which is prone to hot partitions.
Replicate and scale beyond a single region / comply with data locality regulations and survive regional outagesLimited—supports only a few secondary regions with read-only clusters consisting of a modest number of replica instances.
High resilience, rapid failure recovery, fast failover, retryable writes, multi-regionNo—~30-second failover, no retryable writes, and no multi-region support within a single or elastic cluster.
Multi-statement distributed ACID transactionsLimited—ambiguous commits, poor error handling, small data sizes; transactions are not supported across shards in elastic clusters.
Integrated text search, geospatial processing, graph traversalsLimited—basic functionality for text search and geospatial operators.
Native support for time series dataNo

Hedged Reads

Queries submitted to multiple replicas for consistent low latency

No
Online archive (automatically tier data out to cloud object storage, Amazon S3)No
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.
Advanced aggregation features (on-demand materialized views, $merge aggregation stage)No
Schema governanceLimited—$jsonSchema is supported but there are no bypass options.
Rich data typesLimited—supports decimal128 values, but lacks advanced aggregation features for them.
Reactive, event-driven data pipelinesLimited—change streams run against the primary only and incur additional cost.
Role-based access control and authentication restrictionsLimited—offers only coarse-grained roles.
Fine-grained monitoring telemetry & prescriptive performance recommendationsNo—provides fewer than 50 metrics.
Client-side field level encryption for fine-grained separation of duties in the cloudLimited—only supports point equality queries. No support for automatic encryption.
Queryable EncryptionNo
Availability of advanced developer and analysis toolsLimited
Freedom from vendor lock-inNo—available on AWS only.
Develop & run anywhereNo—available on AWS only.
Access to MongoDB expertiseNo
Stream processingNo
Amazon DocumentDB
Fully compatible with MongoDB

No, incomplete.

Imitation API fails 43% of correctness tests.

Support for latest MongoDB versionNo
Scale writes and partition data beyond a single node / sharding supportLimited—sharding is available within an elastic cluster deployment using only hash-sharding, which is prone to hot partitions.
Replicate and scale beyond a single region / comply with data locality regulations and survive regional outagesLimited—supports only a few secondary regions with read-only clusters consisting of a modest number of replica instances.
High resilience, rapid failure recovery, fast failover, retryable writes, multi-regionNo—~30-second failover, no retryable writes, and no multi-region support within a single or elastic cluster.
Multi-statement distributed ACID transactionsLimited—ambiguous commits, poor error handling, small data sizes; transactions are not supported across shards in elastic clusters.
Integrated text search, geospatial processing, graph traversalsLimited—basic functionality for text search and geospatial operators.
Native support for time series dataNo

Hedged Reads

Queries submitted to multiple replicas for consistent low latency

No
Online archive (automatically tier data out to cloud object storage, Amazon S3)No
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.
Advanced aggregation features (on-demand materialized views, $merge aggregation stage)No
Schema governanceLimited—$jsonSchema is supported but there are no bypass options.
Rich data typesLimited—supports decimal128 values, but lacks advanced aggregation features for them.
Reactive, event-driven data pipelinesLimited—change streams run against the primary only and incur additional cost.
Role-based access control and authentication restrictionsLimited—offers only coarse-grained roles.
Fine-grained monitoring telemetry & prescriptive performance recommendationsNo—provides fewer than 50 metrics.
Client-side field level encryption for fine-grained separation of duties in the cloudLimited—only supports point equality queries. No support for automatic encryption.
Queryable EncryptionNo
Availability of advanced developer and analysis toolsLimited
Freedom from vendor lock-inNo—available on AWS only.
Develop & run anywhereNo—available on AWS only.
Access to MongoDB expertiseNo
Stream processingNo
MongoDB Atlas
Fully compatible with MongoDBYes
Support for latest MongoDB versionYes
Scale writes and partition data beyond a single node / sharding supportYes—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 outagesYes—global clusters with up to 50 replicas per shard across multiple regions.
High resilience, rapid failure recovery, fast failover, retryable writes, multi-regionYes
Multi-statement distributed ACID transactionsYes
Integrated text search, geospatial processing, graph traversalsYes—all available from a single API and platform.
Native support for time series dataYes

Hedged Reads

Queries submitted to multiple replicas for consistent low latency

Yes
Online archive (automatically tier data out to cloud object storage, Amazon S3)Yes
Federated queries (integrated querying of data in the database and cold storage)

Yes.

Atlas Data Federation, compatible with AWS S3, Azure Blob Storage, and Google Cloud.

Advanced aggregation features (on-demand materialized views, $merge aggregation stage)Yes
Schema governanceYes—supports JSON schema.
Rich data typesYes
Reactive, event-driven data pipelinesYes—supports MongoDB Change Streams and Atlas Triggers.
Role-based access control and authentication restrictionsYes
Fine-grained monitoring telemetry & prescriptive performance recommendationsYes—over 100 metrics with Performance Advisor for index and schema recommendations.
Client-side field level encryption for fine-grained separation of duties in the cloudYes
Queryable EncryptionYes
Availability of advanced developer and analysis toolsYes—includes MongoDB Compass, Charts, SQL Connector, Tableau Connector, Power BI Connector, and Spark Connector.
Freedom from vendor lock-inYes—available on AWS, Azure, and Google Cloud, with a presence in 110+ regions.
Develop & run anywhereYes
Access to MongoDB expertiseYes
Stream processingYes

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:

  • Automated database and infrastructure provisioning along with auto-scaling so teams can get the database resources they need, when they need them, and can elastically scale in response to application demands.

  • Security features to protect your data, with network isolation, fine-grained access control, auditing, and end-to-end encryption down to the level of individual fields, enabling you to comply with regulations such as ISO, HIPAA, and GDPR. Built-in replication both within and across regions for always-on availability.

  • Global clusters for a fully managed, globally distributed database that provides low latency, responsive reads and writes to users anywhere, with strong data placement controls for regulatory compliance.

  • Combined transactional and analytical capabilities with Atlas analytics nodes to isolate analytics queries from operational workloads while providing real-time insight. Native MongoDB analytics tools, such as MongoDB Charts and MongoDB Connectors (for SQL, Tableau, Power BI, and Spark,) are configured to utilize analytics nodes by default. MongoDB's rich aggregation pipeline engine allows users to run expressive queries against their data.

  • Fully integrated native MongoDB data visualization tools—MongoDB Charts, which supports the full richness of the document model, including nested, hierarchical, and geospatial data, with embedding and sharing capabilities. Quickly build visualizations of your data without needing to deploy or manage any software or infrastructure.

  • Fully integrated MongoDB Atlas Data Federation, which allows users to quickly run federated queries across Atlas clusters and data stored on Amazon S3 in many formats. The MongoDB Query Language (MQL) and tools allow users to get value from data faster.

  • Fully managed backups with point-in-time recovery to protect against data corruption.

  • Automatic data tiering, which helps lower costs by moving data to lower-cost storage such as Amazon S3.

  • Fine-grained monitoring and customizable alerts for comprehensive performance visibility.

  • Automated patching and single-click upgrades for new major versions of the database, enabling you to take advantage of the latest MongoDB features.

  • Native time-series support optimized for both highly performant data ingestion and querying, along with reduced I/O and storage overhead.

  • Full-text and vector search provide rich search capabilities against your fully managed databases with no additional infrastructure or systems to provision, manage, or scale.

  • Live migration to move your self-managed MongoDB clusters into the Atlas service or to move Atlas clusters between cloud providers.

  • Stable API to make upgrades risk-free, future-proofing your development.

  • Widespread coverage on the major cloud platforms with availability in 125+ cloud regions across Amazon Web Services, Microsoft Azure, and Google Cloud. MongoDB Atlas delivers a consistent experience across each of the cloud platforms, ensuring developers can deploy wherever they need to, without compromising critical functionality or risking lock-in.

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.

Beyond the database, MongoDB Atlas Data Federation allows you to simultaneously query data in any format on Amazon S3 and in Atlas clusters using the MongoDB Query Language (MQL). With Atlas Data Federation, you can realize the value of your data lake faster. You don't have to move data anywhere—you can work with complex data immediately in its native form, and with its fully-managed, serverless architecture, you control costs and remove the operational burden. DocumentDB offers no equivalent capability, so users must spin up an entirely separate service with a different query language to access S3 data.

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

Is DocumentDB Compatible with MongoDB?

DocumentDB claims to support the MongoDB 5.0 API, which implies that it is at parity with MongoDB v5.0, released in July 2021. However, this is only partially true, as DocumentDB does not support the majority of MongoDB v5.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

When should I use a document database?

Document databases store data in JSON-like documents, which makes them inherently easy for developers to work with. MongoDB is a modern document database that contains many of the powerful features found in popular relational databases. These include ACID-compliant transactions, schema governance, enterprise-grade security, and more.

Can MongoDB read data from Amazon S3?

MongoDB offers the Atlas Data Federation engine, which allows users to quickly and easily query data in any format on Amazon S3 using the MongoDB Query API.

What are the key differences between MongoDB and DocumentDB?

DocumentDB does not contain any MongoDB code, supports a limited subset of MongoDB features, and is more costly and difficult to manage.

Does DocumentDB share indexing capabilities with MongoDB?

DocumentDB secondary indexes are built to behave similarly to their MongoDB counterparts. However, DocumentDB's full-text search and vector search indexes are more limited in quantity and functionality.

How does DocumentDB handle disaster recovery?

Both DocumentDB and MongoDB support automated backups, as well as incremental and on-demand snapshots. However, DocumentDB requires the creation of a new cluster for restoring a backup. MongoDB simplifies this process by enabling backup restoration to existing clusters.

Is DocumentDB's pricing model the same as MongoDB Atlas?

For non-sharded clusters, DocumentDB offers billing options similar to Atlas: instance-based billing and I/O-optimized billing. However, global clusters only offer an I/O-based pricing model, and DocumentDB's version of sharded clusters (elastic clusters) is billed using a more abstract, difficult-to-predict vCPU-consumption model.