Skip to main content
Cloud & AI Hub
Browse
Glossary AI Directory Playgrounds Models Prompts Explainers Strategy Matrix Benchmark Decoder

DocumentDB

AWS's managed MongoDB-compatible database — Aurora-style storage with the Mongo API on top, and a compatibility asterisk you must test against.

Last reviewed: July 25, 2026

What is DocumentDB?

Amazon DocumentDB is a managed document database that speaks the MongoDB wire protocol atop AWS’s Aurora-style architecture: a distributed storage layer replicating six ways across three AZs, with compute instances scaling independently — up to 15 read replicas sharing one storage volume, failover in under a minute. You point existing Mongo drivers and tools at it; AWS operates the machinery.

The compatibility asterisk

DocumentDB is Mongo-compatible, not Mongo. It emulates the API (4.0/5.0-era compatibility levels) over a different engine, and the gaps are real: unsupported operators and aggregation stages, different index behaviors, no sharded-cluster semantics of the Atlas variety. The only honest migration methodology is running your actual workload’s query suite against it — the official compatibility page plus your integration tests, not the marketing page. Teams that skip this discover the one aggregation pipeline powering their dashboard is unsupported, in week three.

DocumentDB versus the alternatives

Against MongoDB Atlas: Atlas gives full compatibility and newer engine features, at the cost of a second vendor and typically higher spend; DocumentDB gives VPC-native integration, IAM/KMS/CloudTrail alignment, and one-bill simplicity. Against DynamoDB: DynamoDB is the AWS-native choice for known access patterns at massive scale; DocumentDB fits Mongo-shaped applications with ad-hoc queries and existing driver code. The elastic-clusters mode adds sharding for write scale beyond a single primary.

What people get wrong

  • Lift-and-shift without the test suite — compatibility gaps surface in production aggregation pipelines.
  • Ignoring I/O pricing: like Aurora, I/O charges can dominate for scan-heavy workloads; the I/O-optimized configuration exists for exactly that profile.
  • Reading from the primary only — the replica fleet is where read scale lives; use reader endpoints.

Primary source: Amazon DocumentDB documentation

DocumentDB’s MongoDB Compatibility Layer

Amazon DocumentDB is designed to be compatible with the MongoDB API, letting applications built against MongoDB’s query language and drivers run against DocumentDB with minimal code changes, while DocumentDB itself uses a different underlying storage engine built on AWS’s distributed storage architecture rather than actually running MongoDB’s own database engine. This compatibility-layer approach means DocumentDB doesn’t support every MongoDB feature and version exactly (compatibility has historically lagged a few MongoDB major versions behind), which is an important consideration for teams evaluating whether to migrate an existing MongoDB application to DocumentDB versus using MongoDB Atlas or self-hosting MongoDB directly — the right choice depends on how heavily an application relies on specific MongoDB features that DocumentDB may not fully replicate.

Advertisement (In-Content)

Historical figures and technical concepts for informational purposes only. Not technical, professional, legal, or financial advice. Sources: Official Documentation.