AWS · Database
Amazon DocumentDB
A managed document database compatible with MongoDB drivers and tools, with storage that grows automatically across three zones.
What it is and what problem it solves
Amazon DocumentDB (with MongoDB compatibility) stores JSON-like documents and lets you use the same application code, drivers and tools you use with MongoDB. Like Aurora, it separates compute from a shared, distributed storage volume that grows automatically, with a primary instance for writes and up to 15 replicas for reads. Elastic clusters shard data for very large workloads, and global clusters replicate across Regions.
When to use it
- Applications built on MongoDB APIs that you want to run as a managed AWS service.
- Content management, catalogues and user profiles with flexible document schemas.
When to avoid it
- Key-value access at huge scale with single-digit-millisecond latency: DynamoDB.
- Features of the latest MongoDB versions that DocumentDB does not support: check compatibility first.
- Relational data with joins and transactions across many tables: Aurora or RDS.
Limits and quotas
| Item | Value | Context | Source |
|---|---|---|---|
| Maximum cluster storage | 256 TiB | On engine version 8.0 and later; 128 TiB on earlier versions. | Source checked |
| Read replicas per cluster | 15 | Source checked |
Quotas and limits change. Check the linked source before designing around a number.
Cost model
What you pay for
Instance-based clusters: instance time, storage per GB-month, I/O per million (none on I/O-Optimized) and backup storage. Serverless: capacity units per hour. Elastic clusters: vCPU-hours and storage. Global clusters add replicated write I/Os.
Where it is cost-efficient
Document workloads that need MongoDB compatibility without running database servers.
Where costs grow
Heavy I/O on the standard configuration, many replicas, and large backups.
Cost controls and common surprises
Choose I/O-Optimized for I/O-heavy workloads, right-size instances, and use reserved capacity where available.
Prices differ by Region and change over time; see the pricing page linked under Sources.
Security
Controls the service provides
VPC-only access, encryption at rest with KMS and in transit with TLS, and role-based access control.
What you configure
Keep clusters private, manage users and roles, and enable auditing for sensitive data.
Logging and monitoring
Audit and profiler logs to CloudWatch Logs; CloudTrail.
Related security services
KMS, Secrets Manager, AWS Backup.
Shared responsibility
AWS manages the infrastructure. You manage data, access and queries.
Availability, backup and failure behavior
Storage is replicated across three Availability Zones; a failed primary is replaced by promoting a replica. Global clusters support Regional disaster recovery.
Common service combinations
Lambda and containers as clients, DMS for migration from MongoDB, Secrets Manager for credentials.
Business application examples
- A content platform moves from self-managed MongoDB to DocumentDB with minimal code changes.
Exam cues and common confusions
- MongoDB-compatible managed database: DocumentDB.
- Migrating from MongoDB: DMS to DocumentDB.
- Purpose-built choices: documents (DocumentDB), key-value (DynamoDB), graph (Neptune), wide-column (Keyspaces), relational (Aurora/RDS).
Related
Courses and lessons
- Purpose-built databases: DocumentDB, Keyspaces, Neptune, Redshift and more · AWS Solutions Architect – Associate (SAA-C03) · Members
Services, comparisons and patterns
- Amazon DynamoDB · Service
- Amazon Aurora · Service
- AWS Database Migration Service (AWS DMS) · Service
Sources
Independent study material, not affiliated with or endorsed by Amazon Web Services. AWS and service names are trademarks of Amazon.com, Inc. or its affiliates.