π Amazon DocumentDB
Not all apps fit rows and columns β many use flexible, document-based data like JSON.
DocumentDB is AWS's fully managed NoSQL document database, compatible with MongoDB β run MongoDB workloads on AWS without managing infrastructure.
π― Exam Tip
β DocumentDB = NoSQL document database
β Compatible with MongoDB
β Stores JSON document data
β Fully managed, highly available
β "MongoDB" β DocumentDB
β "NoSQL database" β could be DocumentDB or DynamoDB, depending on the use case
π§ Core Idea
Just as Aurora is AWS's cloud-native take on MySQL/PostgreSQL, DocumentDB is AWS's managed service compatible with MongoDB.
Database Technology | AWS Managed Service |
|---|---|
MySQL / PostgreSQL | Amazon Aurora |
MongoDB | Amazon DocumentDB |
AWS handles infrastructure, backups, availability, and scaling β you focus on the app.
π What is MongoDB?
One of the world's most popular NoSQL document databases β stores data as JSON-like documents instead of rows/columns.
{ "customer": "Diya", "country": "India", "sales": 120 }Each document can have a different structure β far more flexible than relational tables. DocumentDB is built to be MongoDB-compatible, so many MongoDB apps migrate with minimal changes.
π¦ Storing JSON Documents
DocumentDB stores collections of JSON documents instead of tables:
Customers Collection
{ "name": "Diya", "country": "India", "sales": 120 }
{ "name": "Bob", "country": "USA", "sales": 95 }
{ "name": "Carol", "country": "France", "sales": 210 }Store, retrieve, query, and index these documents easily.
βοΈ Key Features
β Fully managed by AWS
β MongoDB-compatible
β Highly available
β Automatic backups
β Automatic scaling
β High performance
No software installs, patches, or servers to manage.
Like Aurora, data is automatically replicated across three Availability Zones in a Region.
AWS Region
AZ A β replicates β AZ B β replicates β AZ CStorage grows in 10 GB increments automatically β no manual allocation.
Scales to handle millions of requests per second for high-traffic apps.
π When to Use DocumentDB
Your app uses MongoDB
You store JSON documents
You need a flexible NoSQL database
You need high availability
You want automatic scaling with managed infrastructure
π DocumentDB vs DynamoDB
Both are NoSQL, but built for different jobs:
DocumentDB | DynamoDB |
|---|---|
MongoDB-compatible | AWS-native NoSQL |
Stores JSON documents | Key-value + document data |
Best for MongoDB workloads | Best for highly scalable key-value apps |
π― Exam shortcut: MongoDB β DocumentDB. AWS-native NoSQL β DynamoDB.
π Summary
π DocumentDB = fully managed NoSQL document database
π MongoDB-compatible
ποΈ Stores JSON documents, not tables
π Auto-replicated across 3 AZs
π Storage grows in 10 GB increments
π Scales to millions of requests/sec
π― Exam takeaway: MongoDB β DocumentDB; NoSQL in general β DocumentDB or DynamoDB, depending on scenario