AWS · explainer · checked November 3, 2026
DynamoDB vs MongoDB vs DocumentDB: which AWS database fits your data
Amazon DynamoDB is a serverless AWS database where you design tables around queries you know in advance. MongoDB is a document database with flexible queries and aggregation. Amazon DocumentDB is the AWS-managed service that speaks the MongoDB API, so existing MongoDB code can move with little change. Pick DynamoDB for predictable access patterns at scale, MongoDB or DocumentDB when queries vary.
Side by side
| Amazon DynamoDB | MongoDB | Amazon DocumentDB | Amazon Keyspaces | Amazon RDS / Aurora PostgreSQL | Amazon ElastiCache | |
|---|---|---|---|---|---|---|
| Data model | Key-value and document | JSON-like documents in collections | Documents, MongoDB-compatible | Wide-column, Apache Cassandra-compatible | Relational tables and SQL | In-memory data store or cache (Valkey, Memcached, Redis OSS) |
| Run by | AWS, serverless | You, or MongoDB’s own managed service, Atlas | AWS, managed clusters | AWS, serverless | AWS, managed instances or clusters | AWS, serverless or node-based |
| Reach for it when | Known access patterns, any scale, no servers | Varied queries on document data | You run MongoDB workloads and want AWS to manage them | You run Cassandra workloads | Relational data and flexible queries | Very fast reads in front of another database |
DynamoDB designs around access patterns
Amazon DynamoDB is a serverless, fully managed, distributed NoSQL database that supports key-value and document data. There are no servers to patch and no maintenance windows. It has no JOIN operator, and AWS recommends denormalizing your data to cut the round trips and processing a query needs.
That shapes how you build. In a relational database you model the data first and write queries later. In DynamoDB the AWS guide says not to design the schema until you know the questions it must answer, and to keep as few tables as possible. Data can be queried efficiently in a limited number of ways: by primary key, or by an alternate key you add with a secondary index. Anything else can be slow and expensive, because the data’s shape is meant to match what you query. Within those patterns you get consistent single-digit millisecond performance whether the table holds a hundred users or a hundred million.
DynamoDB also supports ACID transactions across one or more tables, and global tables that replicate across Regions with any replica accepting reads and writes.
Capacity: on-demand or provisioned
A DynamoDB table uses one of two capacity modes. On-demand mode is pay-per-request with no capacity planning, and AWS calls it the default and recommended choice for most workloads. In provisioned mode you state the reads and writes per second you need and pay for that provisioned capacity whether or not you use it. AWS suggests it for steady workloads with predictable growth and cost control.
DocumentDB instance-based clusters work the other way: you choose the instance class for each instance and scale compute up or down yourself, and the storage volume grows on its own.
MongoDB's flexible model, fairly stated
MongoDB stores data as documents: field and value pairs that can hold embedded documents and arrays, similar to JSON. Its documentation says the flexible schema lets you evolve the model without downtime, handle non-uniform data, and map data to how your application’s objects look. Embedded documents and arrays reduce the need for joins.
For querying, MongoDB offers a query engine, an aggregation pipeline made of stages that filter, group and reshape documents, full-text search, vector search, geospatial search and time series. It supports multi-document ACID transactions, including across sharded clusters, and scales horizontally by sharding on a shard key.
If your questions change often, you run analysis-style queries over documents, or you want one database that does search and aggregation, MongoDB is the stronger fit. DynamoDB gives that up in exchange for a serverless service with predictable performance. MongoDB’s own hosted service is MongoDB Atlas, a multi-cloud database service.
Amazon DocumentDB: MongoDB APIs, run by AWS
Amazon DocumentDB (with MongoDB compatibility) is a managed AWS service that lets you use the same application code, drivers and tools as MongoDB. AWS states compatibility with MongoDB 4.0, 5.0 and 8.0, and that a vast majority of applications, drivers and tools work with little or no change. It is not MongoDB: AWS publishes a page of functional differences, so test the features you rely on.
Its design looks like Aurora. Storage is a cluster volume holding six copies of your data across three Availability Zones, and you can add up to 15 replicas that share that storage and fail over automatically. Elastic clusters extend it to millions of reads and writes per second.
For “DocumentDB or DynamoDB”: choose DocumentDB when the application already speaks the MongoDB API and needs MongoDB-style queries. Choose DynamoDB when you are building new, you know the access patterns, and you want a serverless service. For “DocumentDB or MongoDB”: DocumentDB if you want AWS to operate a MongoDB-compatible database inside your VPC, MongoDB if you need features the compatibility page does not list.
Cassandra, PostgreSQL and Redis
The other searches are different jobs, and the table places them. Amazon Keyspaces (for Apache Cassandra) is a serverless, Cassandra-compatible service, so it suits existing Cassandra workloads and code. Amazon RDS and Aurora PostgreSQL are relational: choose them for SQL, joins and queries you cannot list in advance. Amazon ElastiCache is an in-memory data store or cache. You can run it as a serverless cache or as node-based clusters, with the Valkey, Memcached or Redis OSS engine. A cache is normally added next to a database to make reads faster, not used in place of one.
On the exams
How certification exams use this
The exam guides ask candidates to choose AWS data stores based on access patterns (DVA-C03 task 1.3), to determine an appropriate database type such as Aurora or DynamoDB (SAA-C03 task 3.3), and for DVA-C03 to configure DynamoDB with high-cardinality partition keys, read consistency models, queries and scans, and indexes. The wording to watch is “known access patterns”, “single-digit millisecond”, “serverless” and “no capacity planning”, which point at DynamoDB, while “existing MongoDB application” or “MongoDB-compatible” points at DocumentDB and “Cassandra” at Keyspaces. A common wrong answer is a relational database for a key-based workload, or DynamoDB for ad hoc queries.
Test yourself
See how well you know it, free.
Each exam’s diagnostic is free, with no sign-in: questions across the whole exam, and a map of what you know and what you don’t.
AWS Certified Solutions Architect – Associate
20 free questions, no sign-in.
Take the free diagnosticAbout the examAWS Certified Developer – Associate
20 free questions, no sign-in.
Take the free diagnosticAbout the examAWS Certified Solutions Architect – Professional
20 free questions, no sign-in.
Take the free diagnosticAbout the examAWS Certified Data Engineer – Associate
20 free questions, no sign-in.
Take the free diagnosticAbout the examAWS Certified Cloud Practitioner
20 free questions, no sign-in.
Take the free diagnosticAbout the exam
Sources
Checked against the vendors’ own documentation.
- DynamoDB provisioned capacity mode
- What is Amazon ElastiCache?
- Sharding (MongoDB manual)
- MongoDB Atlas
- What is Amazon DynamoDB?
- NoSQL design for DynamoDB
- DynamoDB throughput capacity
- What is Amazon DocumentDB (with MongoDB compatibility)?
- Amazon DocumentDB compatibility with MongoDB
- What is MongoDB?
- Aggregation Pipeline
- What is Amazon Keyspaces (for Apache Cassandra)?
Last checked November 3, 2026. Spotted something wrong or out of date? Tell us.