Amazon Web Services
Compute
- AWS EC2
- EC2 Instance Types
- EC2 Pricing Models
- EC2 Auto Scaling
- Elastic Load Balancing-ELB
- AWS Lambda โ Serverless Computing
- Amazon Lightsail
- AWS Elastic Beanstalk
- AWS Fargate
- Amazon ECS (Elastic Container Service)
- Amazon EKS (Elastic Kubernetes Service)
Storage
- S3 vs. EBS vs. EFS
- Amazon S3 (Simple Storage Service)
- Amazon S3 Storage Classes
- Amazon EBS (Elastic Block Store)
- Amazon EFS (Elastic File System)
- AWS Storage Gateway
- AWS Snowball
- Amazon FSx
- AWS Backup
Database Services
- Amazon RDS
- Amazon Aurora
- Amazon DynamoDB
- Amazon ElastiCache
- Amazon Redshift
- AWS Database Migration Service (DMS)
- Amazon Neptune
- Amazon DocumentD
Networking and Content Delivery
- Amazon VPC
- Subnets
- Internet Gateway
- AWS Direct Connect
- AWS Route 53
- AWS CloudFront
- AWS Transit Gateway
- Elastic IP Addresses
DynamoDB
- DynamoDB Global Table vs Regular DynamoDB Table
- DynamoDB Streams
- Athena query data to DynamoDB
- Athena Query Results with DynamoDB
- PySpark DataFrame to DynamoDB
Redshift
Lambda
Glue
Lambda
Security
๐ Amazon DocumentDB โ Managed Document Database Compatible with MongoDB
In todayโs digital world, applications must process vast amounts of semi-structured or unstructured data like user profiles, IoT data, product catalogs, and logs. Relational databases arenโt always the right fit for this type of data.
Thatโs where Amazon DocumentDB comes in. It is a fully managed document database service designed for scalable, secure, and high-performance storage of JSON-like data. Best of all, it is compatible with MongoDB, meaning developers can use their existing MongoDB drivers, tools, and queries with minimal changes.
Amazon DocumentDB is widely used for modern applications that require flexibility, fast iteration, and scalable storage without worrying about database maintenance.
โ๏ธ Key Features of Amazon DocumentDB
- MongoDB Compatibility โ Works with existing MongoDB drivers and APIs.
- Fully Managed โ Automated backups, patching, monitoring, and scaling.
- High Scalability โ Storage automatically grows up to 64TB per cluster.
- Performance โ Optimized for low-latency document queries and indexing.
- High Availability โ Multi-AZ replication with automatic failover.
- Secure โ Supports VPC, IAM, KMS encryption, and TLS connections.
- Serverless Backup & Restore โ Point-in-time recovery for disaster recovery.
- Integration โ Works seamlessly with AWS services like Lambda, CloudWatch, and Kinesis.
- Read Scaling โ Add up to 15 read replicas.
- Use Cases โ Catalogs, user profiles, content management, IoT apps, and mobile apps.
๐๏ธ Common Use Cases
Use Case | Description |
---|---|
Product Catalogs | Store product info with varying attributes and categories. |
User Profiles | Save flexible schema data like preferences and activities. |
Mobile/IoT Applications | Handle sensor data and mobile app interactions at scale. |
Content Management | Manage articles, blogs, or multimedia metadata. |
Gaming Data | Store player scores, sessions, and social interactions. |
๐ ๏ธ Programs
โ Insert and Retrieve User Profile
from pymongo import MongoClient
# Connect to DocumentDBclient = MongoClient( "mongodb://username:password@your-docdb-endpoint:27017/?ssl=true&replicaSet=rs0")db = client['myapp']users = db['users']
# Insert a user documentusers.insert_one({ "user_id": "u1", "name": "Alice", "age": 29, "interests": ["music", "travel", "reading"]})
# Query userresult = users.find_one({"user_id": "u1"})print(result)
Use Case: Store and fetch user profiles dynamically.
โ Product Catalog with Flexible Schema
from pymongo import MongoClient
client = MongoClient("mongodb://username:password@your-docdb-endpoint:27017/?ssl=true&replicaSet=rs0")db = client['ecommerce']products = db['products']
# Insert different product typesproducts.insert_many([ {"product_id": "p1", "name": "Laptop", "brand": "Dell", "price": 1200}, {"product_id": "p2", "name": "Headphones", "brand": "Sony", "features": ["Noise Canceling", "Wireless"]}])
# Query products with brand Sonyfor p in products.find({"brand": "Sony"}): print(p)
Use Case: Manage catalogs with flexible attributes.
โ Real-Time IoT Data Ingestion
import datetimefrom pymongo import MongoClient
client = MongoClient("mongodb://username:password@your-docdb-endpoint:27017/?ssl=true&replicaSet=rs0")db = client['iot']sensors = db['sensors']
# Insert sensor datasensors.insert_one({ "device_id": "sensor_01", "temperature": 22.5, "humidity": 45, "timestamp": datetime.datetime.utcnow()})
# Query recent datarecent = sensors.find().sort("timestamp", -1).limit(1)for r in recent: print(r)
Use Case: Store IoT sensor data and fetch the latest readings.
๐ง How to Remember Amazon DocumentDB for Exams & Interviews
-
Acronym โDOCSโ
- D โ Document-based storage (JSON-like).
- O โ Optimized for scalability & availability.
- C โ Compatible with MongoDB.
- S โ Secure and serverless management.
-
Memory Trick: Think of DocumentDB as โMongoDB in AWS clothesโ โ it looks and acts like MongoDB but runs fully managed in AWS.
-
Exam Hot Points:
- MongoDB API compatibility.
- Auto-scaling storage up to 64TB.
- Multi-AZ replication with read replicas.
- Use cases: user profiles, catalogs, IoT apps.
๐ฏ Why It Is Important to Learn Amazon DocumentDB
- MongoDB Popularity โ MongoDB is widely used; DocumentDB helps enterprises migrate easily.
- Cloud-Native Development โ Supports serverless apps, IoT, and microservices.
- High Demand in Jobs โ Companies look for AWS engineers with NoSQL knowledge.
- Exam Relevance โ Appears in AWS Developer Associate, Database Specialty, and Solutions Architect exams.
- Future Growth โ As semi-structured data grows, document databases are key for modern apps.
๐ Best Practices
- Use indexes to improve query performance.
- Secure with IAM roles and TLS encryption.
- Design schema to support frequent queries.
- Use replicas for read scaling.
- Monitor with CloudWatch for performance optimization.
๐ Conclusion
Amazon DocumentDB is a managed, MongoDB-compatible document database that offers flexibility, scalability, and ease of use. It is perfect for workloads with dynamic schemas like user profiles, catalogs, IoT data, and content management.
For exam preparation and interviews, always remember:
- It is MongoDB-compatible.
- Offers scalable, secure, multi-AZ managed service.
- Best suited for semi-structured and unstructured data use cases.
By learning DocumentDB, youโll gain a critical skill for cloud-native applications and strengthen your AWS expertise.