Comparing Amazon DocumentDB and MongoDB

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 Amazon’s Aurora backend platform. This creates significant architectural constraints, functionality limitations, and broken compatibility.

The DocumentDB feature set most closely resembles MongoDB 2.6, introduced in 2014, and compatibility testing reveals it fails 65% of the MongoDB API correctness tests. Applications written for MongoDB will need to be re-written to work with Amazon DocumentDB.

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 60%+ of correctness tests

Support for latest MongoDB version

No
Feature set resembles MongoDB 2.6, released in 2014.

Scale writes and partition data beyond a single node / Sharding support

No
No sharding, single primary only. Largest instance supports 4,500 concurrent connections.

Replicate and scale beyond a single region / Comply with data locality regulations and survive regional outages

No
Single primary constrained to a single region, with up to 15 replicas

High resilience, rapid failure recovery, fast failover, retryable writes, multi-region

No
Up to 120 second failover, no retryable writes, no multi-region in a single cluster

Multi-statement distributed ACID transactions

No
Single statement only. Transactions across shards are not applicable as DocumentDB does not support sharding

Integrated text search, geospatial processing, graph traversals

No
Data must be replicated to multiple adjacent AWS services, driving up cost and complexity

Integrated querying of data in Amazon S3

No
Data must be replicated to separate AWS services

On-demand Materialized ViewsNo
Schema governance

No
Schema controls must be enforced in the app

Rich data types

Limited
With no decimal data type, DocumentDB lacks support for lossless processing of complex numeric data

Reactive, event-driven data pipelines

Limited
Limited change streams

Hedged Reads
Queries submitted to multiple replicas for consistent low latency

No
Support for role-based access control and authentication restrictions

Limited
Coarse-grained roles only

Availability of advanced developer and analysis toolsNo
Fine-grained monitoring telemetry & prescriptive performance recommendations

No
Just ~40 metrics

Freedom from vendor lock-in

No
AWS only. Constrained to just a subset of regions

Develop & run anywhere
On your mobile device, on your laptop, in your own data center, and in hybrid configurations

No
AWS only

Access to MongoDB expertiseNo
Amazon DocumentDB
Fully compatible with MongoDB

No, incomplete
Imitation API fails 60%+ of correctness tests

Support for latest MongoDB version

No
Feature set resembles MongoDB 2.6, released in 2014.

Scale writes and partition data beyond a single node / Sharding support

No
No sharding, single primary only. Largest instance supports 4,500 concurrent connections.

Replicate and scale beyond a single region / Comply with data locality regulations and survive regional outages

No
Single primary constrained to a single region, with up to 15 replicas

High resilience, rapid failure recovery, fast failover, retryable writes, multi-region

No
Up to 120 second failover, no retryable writes, no multi-region in a single cluster

Multi-statement distributed ACID transactions

No
Single statement only. Transactions across shards are not applicable as DocumentDB does not support sharding

Integrated text search, geospatial processing, graph traversals

No
Data must be replicated to multiple adjacent AWS services, driving up cost and complexity

Integrated querying of data in Amazon S3

No
Data must be replicated to separate AWS services

On-demand Materialized ViewsNo
Schema governance

No
Schema controls must be enforced in the app

Rich data types

Limited
With no decimal data type, DocumentDB lacks support for lossless processing of complex numeric data

Reactive, event-driven data pipelines

Limited
Limited change streams

Hedged Reads
Queries submitted to multiple replicas for consistent low latency

No
Support for role-based access control and authentication restrictions

Limited
Coarse-grained roles only

Availability of advanced developer and analysis toolsNo
Fine-grained monitoring telemetry & prescriptive performance recommendations

No
Just ~40 metrics

Freedom from vendor lock-in

No
AWS only. Constrained to just a subset of regions

Develop & run anywhere
On your mobile device, on your laptop, in your own data center, and in hybrid configurations

No
AWS only

Access to MongoDB expertiseNo
MongoDB Atlas
Fully compatible with MongoDBYes
Support for latest MongoDB version

Yes
MongoDB 4.4

Scale writes and partition data beyond a single node / Sharding support

Yes
Largest Atlas instance supports 128,000 concurrent connections. Full sharding support.

Replicate and scale beyond a single region / Comply with data locality regulations and survive regional outages

Yes
Global clusters, with up to 50 replicas per shard across multiple regions

High resilience, rapid failure recovery, fast failover, retryable writes, multi-region

Yes
Typical failover of 5 seconds, failed reads and writes auto-retried, cluster distributed across multiple regions<

Multi-statement distributed ACID transactionsYes
Integrated text search, geospatial processing, graph traversals

Yes
All available from a single API and platform

Integrated querying of data in Amazon S3

Yes
Atlas Data Lake

On-demand Materialized Views

Yes
$merge aggregation stage

Schema governance

Yes
JSON schema

Rich data typesYes
Reactive, event-driven data pipelines

Yes
MongoDB Change Streams & Atlas Triggers

Hedged Reads
Queries submitted to multiple replicas for consistent low latency

Yes
Support for role-based access control and authentication restrictionsYes
Availability of advanced developer and analysis tools

Yes
MongoDB Compass, Charts, BI Connector, Spark Connector

Fine-grained monitoring telemetry & prescriptive performance recommendations

Yes
More than 100 metrics. Performance Advisor for index recommendations

Freedom from vendor lock-in

Yes
AWS, Azure, and GCP. Fully-managed, on-demand service available on 70+ regions

Develop & run anywhere
On your mobile device, on your laptop, in your own data center, and in hybrid configurations

Yes
MongoDB Realm / MongoDB Server

Access to MongoDB expertise

Yes
Hundreds of engineers with multi-year MongoDB development, support, and consulting experience.

What is MongoDB Atlas?

MongoDB offers the fully managed, on-demand and global MongoDB Atlas service, in the public cloud. Atlas enables customers to deploy, operate, and scale MongoDB databases on AWS, Azure, or GCP. 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 Connector for BI are configured to utilize Analytics Nodes by default.

  • Fully integrated native MongoDB data visualization tools – MongoDB Charts, which supports the full richness of the document model, including nested, hierarchical and geospatial data and provide 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 Lake which allows you to quickly and easily query data in any format on Amazon S3 using the MongoDB Query Language (MQL) and tools and get value from your data faster.

  • Fully managed backups with point in time recovery to protect against data corruption, and the ability to query backups in-place without full restores.

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

  • Access to the MongoDB Realm application platform, with QueryAnywhere, Functions, and Atlas Triggers delivered in a completely serverless model.

  • The Full-Text Search service providing 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.

  • Widespread coverage on the major cloud platforms with availability in 60+ cloud regions across Amazon Web Services, Microsoft Azure, and Google Cloud Platform. 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, the MongoDB Atlas Data Lake allows you to quickly and easily query data in any format on Amazon S3 using the MongoDB Query Language (MQL) and tools. You can spin up your data lake right alongside your Atlas OLTP clusters from a common UI. With Atlas Data Lake 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, and so users must spin up an entirely separate service with a different query language to access S3 data.

Built and run by the same team that develops the data platform, MongoDB Atlas is the best way to run MongoDB apps.