DynamoDB vs Amazon DocumentDB
Both are fully managed AWS NoSQL databases, but they solve different problems. DynamoDB is a serverless key-value and document store; Amazon DocumentDB is a MongoDB-compatible document database. This page compares them factually so you can pick the right one before you commit to a data model.
What is the difference between DynamoDB and DocumentDB?
DynamoDB is a serverless key-value and document database with no servers or clusters to manage — you scale by request volume or provisioned capacity. Amazon DocumentDB is a MongoDB-compatible document database that runs on a cluster of instances (a primary plus read replicas). DynamoDB uses its own API; DocumentDB speaks the MongoDB API, so existing MongoDB apps, drivers, and tools work against it.
DynamoDB vs Amazon DocumentDB at a glance
| Characteristic | DynamoDB | Amazon DocumentDB |
|---|---|---|
| Data model | Key-value and document (items with typed attributes) | Document (JSON/BSON documents in collections) |
| Query API | DynamoDB API (GetItem, Query, Scan, PutItem, UpdateItem) plus PartiQL | MongoDB API — the same drivers, tools, and mongo/mongosh shell you use with MongoDB |
| Max record size | 400 KB per item | 16 MB per document (BSON, the MongoDB document limit) |
| Indexes | Global secondary indexes (GSI) and local secondary indexes (LSI) | MongoDB-style secondary indexes, including compound indexes |
| Consistency | Eventually consistent by default; optional strongly consistent reads; ACID transactions | Reads from the primary are strongly consistent; replica reads can be eventually consistent (read preference); ACID transactions |
| Scaling / provisioning | Serverless — no instances or clusters; on-demand or provisioned capacity | Instance-based cluster (a primary plus up to 15 replicas) or elastic clusters; a serverless instance class is also available |
| Pricing model | Pay-per-request (on-demand) or provisioned read/write capacity, plus storage | Per-instance-hour compute, plus I/O requests, storage, and backup storage |
| Best fit | High-scale key-value and serverless workloads with known access patterns | Existing MongoDB workloads and document apps that need the MongoDB API on AWS |
Sizes follow each service's own documentation. DynamoDB measures size in binary units (1 KB = 1024 bytes); the 16 MB DocumentDB figure is the standard MongoDB BSON document limit.
When DynamoDB is the better choice
- You want zero infrastructure to manage. DynamoDB has no instances, clusters, or replicas to size, patch, or fail over — you create a table and read/write it. Capacity is either on-demand (pay per request) or provisioned.
- Your workload is key-value or single-table with known access patterns. DynamoDB rewards designing around your queries up front. See how to model data in DynamoDB and single-table design.
- You need predictable performance at very high scale. DynamoDB delivers single-digit-millisecond reads and writes that stay flat as traffic grows.
- You're building serverless on AWS. DynamoDB pairs naturally with Lambda and pay-per-request billing, with no idle instance cost.
When DocumentDB is the better choice
- You already run MongoDB. DocumentDB is MongoDB-API-compatible, so your existing drivers, tools, and application code can often connect with minimal changes — useful for a lift-and-shift onto AWS.
- You need large documents or rich, ad-hoc queries. DocumentDB's 16 MB document limit is far larger than DynamoDB's 400 KB item, and the MongoDB query language supports flexible filtering and aggregation without pre-designing every access pattern.
- You prefer a document-first model with a familiar API. If your team thinks in MongoDB collections and documents rather than partition/sort keys, DocumentDB keeps that mental model.
Neither is strictly "better" — DynamoDB trades query flexibility for hands-off serverless scale, while DocumentDB trades serverless simplicity for MongoDB compatibility and larger, more flexible documents.
Working with DynamoDB
Once you've chosen DynamoDB, DynoTable is a desktop DynamoDB client for browsing, editing, and querying your tables without the AWS Console. It reads your standard AWS credentials, so your data stays in your account and in DynamoDB.
Because DynamoDB has its own expression syntax rather than SQL or the MongoDB query language, the free DynamoDB Expression Builder helps you build correct key conditions, filter expressions, and update expressions and copy them straight into your SDK code. To sanity-check costs before you migrate, the DynamoDB pricing calculator estimates on-demand and provisioned capacity spend.
FAQ
Is DocumentDB the same as DynamoDB? No. They are two separate AWS database services. DynamoDB is a serverless key-value and document store with its own API, while Amazon DocumentDB is a MongoDB-compatible document database that runs on a cluster of instances. They share no query API and are provisioned, scaled, and priced differently.
Which is cheaper, DynamoDB or DocumentDB? It depends on the workload, so there's no universal answer. DynamoDB bills per request (on-demand) or per provisioned capacity plus storage, with no idle instance cost — often cheaper for spiky or low-baseline traffic. DocumentDB bills per instance-hour plus I/O, storage, and backup, which can be more cost-effective for steady, high-throughput workloads on right-sized instances.
Does DynamoDB support the MongoDB API?
No. DynamoDB uses its own API (GetItem, Query, Scan, PutItem,
UpdateItem) and also supports PartiQL, a SQL-compatible query language. Amazon
DocumentDB is the AWS service that provides MongoDB API compatibility.
Related
- Learn the DynamoDB data types and single-table design before you model a table.
- Compare capacity modes in on-demand vs provisioned.
- Build queries fast with the free DynamoDB Expression Builder, then download DynoTable to work your tables.
Last verified 2026-07-12 against the AWS DynamoDB and Amazon DocumentDB developer guides. Amazon DocumentDB and MongoDB are trademarks of their respective owners, referenced here for identification only.