Amazon DynamoDB is a fully managed, serverless NoSQL database designed to deliver single-digit millisecond performance at any scale.
AWS handles:
- Infrastructure management
- Patching
- Scaling
- Replication
- Backup and restore
DynamoDB is highly available by default, with automatic replication across multiple Availability Zones.
It is built for internet-scale applications and can handle:
- Millions of requests per second
- Trillions of records
- Hundreds of terabytes of storage
DynamoDB is optimized for performance and scalability, making it ideal for modern distributed applications.
Consistency Model (Very Important for Exam)
DynamoDB uses an eventual consistency model by default.
This means:
- Reads may not immediately reflect the latest write.
- Data is replicated across multiple storage nodes.
- The nearest available replica may serve a read request.
Strongly Consistent Reads
You can request strongly consistent reads to always receive the most recent data.
Important considerations:
- Higher latency than eventual consistency
- Uses more read capacity units
- Not supported on Global Secondary Indexes
- May return errors during network partitions
Exam Tip:
If the question prioritizes low latency and high scale → eventual consistency is acceptable.
If the question requires guaranteed latest data → choose strongly consistent reads.
DynamoDB Basics
DynamoDB stores data in tables, and each table must have a Primary Key defined at creation time.
Primary keys cannot be changed later.
Each table:
- Can contain unlimited items
- Supports flexible schema
- Allows adding new attributes at any time
- Supports null values
- Has a maximum item size of 400 KB
Primary Key Types
Partition Key (Simple Primary Key)
- Unique identifier
- Used to distribute data across partitions
If only a partition key exists, it must be unique.
Composite Primary Key (Partition Key + Sort Key)
- Partition Key distributes data
- Sort Key allows multiple items with same partition key
- Enables efficient querying within a partition
DynamoDB automatically partitions (shards) data across storage nodes based on the partition key.
Exam Tip:
Composite key is commonly tested for time-series or ordered data scenarios.
Supported Data Types
Scalar Types:
- String
- Number
- Binary
- Boolean
- Null
Set Types:
- String Set
- Number Set
- Binary Set
Document Types:
Read/Write Capacity Modes
DynamoDB offers two capacity modes.
Provisioned Capacity (Default)
- You define Read Capacity Units (RCUs)
- You define Write Capacity Units (WCUs)
- Supports auto-scaling
- Lower cost for predictable workloads
Best for:
- Steady workloads
- Forecastable traffic
On-Demand Capacity
- No capacity planning
- Automatically scales up and down
- Pay per request
- Higher cost
Best for:
- Unpredictable workloads
- Sudden traffic spikes
- Startups or new applications
Exam Decision Rule:
Predictable workload → Provisioned
Unpredictable workload → On-Demand
Global Tables
DynamoDB Global Tables provide multi-Region, active-active replication.
Features:
- Low-latency reads and writes in multiple Regions
- Automatic replication
- Conflict resolution handled by DynamoDB
- Improves global availability
Prerequisite:
DynamoDB Streams must be enabled.
Exam Scenario:
If question mentions:
- Multi-Region active-active database
- Global user base
- Region failure resilience
Choose DynamoDB Global Tables.
Time to Live (TTL)
TTL automatically deletes expired items from a table.
Key points:
- Uses Unix epoch timestamp (seconds)
- Does not consume write capacity
- Must be enabled on the table
- Background process scans for expired records
Common use cases:
- Session management
- Clickstream data
- Temporary tokens
- Regulatory data cleanup
Exam Tip:
If data needs automatic expiration → Choose TTL.
DynamoDB Streams
DynamoDB Streams capture item-level changes.
Use cases:
- Trigger AWS Lambda
- Real-time event processing
- Integration with Kinesis
- Audit and change tracking
Streams are required for Global Tables.
DynamoDB Accelerator (DAX)
DAX is an in-memory cache for DynamoDB.
- Reduces read latency from milliseconds to microseconds
- Fully managed
- Improves performance for read-heavy workloads
Exam Scenario:
If application requires microsecond latency → Choose DAX.
Backup and Restore
DynamoDB supports:
Point-in-Time Recovery (PITR)
- Retention up to 35 days
- Continuous backups
On-Demand Backups
- Manual
- Long-term retention
Additional capabilities:
- Export to S3 without consuming RCUs
- Import from S3 without consuming WCUs
Security
- Integrated with IAM
- Fine-grained access control
- Encryption at rest (AWS-managed or KMS)
- Encryption in transit (TLS)
Network access is controlled via IAM, not security groups (unless using VPC endpoints).
Common DynamoDB Use Cases
- Gaming leaderboards
- IoT telemetry
- Serverless applications
- Mobile backends
- E-commerce platforms
- Financial transaction systems
- Social media applications
DynamoDB is ideal for:
- Massive scale
- Low-latency applications
- Flexible schema requirements
- Globally distributed systems
High-Value Solutions Architect Exam Tips
- DynamoDB is a NoSQL key-value and document database
- Default consistency is eventual
- Strong consistency costs more and has limitations
- Maximum item size is 400 KB
- Provisioned mode is cheaper for predictable traffic
- On-demand mode is best for unpredictable workloads
- Global Tables provide active-active multi-Region replication
- TTL automatically deletes expired data
- DAX reduces read latency to microseconds
- DynamoDB is serverless and automatically Multi-AZ