AWS Solutions Architect Handbook SAA-C03, from zero Bipin Singh
Databases

Amazon DynamoDB

3 min readChapter 29 of 48By Bipin Singh

Amazon DynamoDB is a fully managed, serverless key-value and document database that delivers single-digit-millisecond performance at virtually any scale. It's a frequent answer for "serverless", "massive scale", "session data" and "least operational overhead" scenarios.

Data model

Capacity modes

On-demand Provisioned
Pricing Pay per request Pay for read/write capacity units per hour
Scaling Instant, automatic Set capacity; use auto scaling to adjust
Best for Unpredictable or spiky traffic, new apps Predictable traffic — usually cheaper at steady load (plus reserved capacity)

Capacity unit maths (provisioned)

Example: 100 strongly consistent reads/second of 6 KB items → each read needs 2 RCU (6 KB rounds up to 8 KB) → 200 RCU. Eventually consistent → 100 RCU.

Indexes

Global secondary index (GSI) Local secondary index (LSI)
Keys Different partition and sort key Same partition key, different sort key
Create Any time Only at table creation
Capacity Its own Shares the table's
Consistency Eventually consistent reads Strong or eventual

Use indexes for alternative query patterns (e.g. look up orders by status).

Performance and caching

Streams and events

Global tables

Multi-Region, multi-active replication: every Region accepts reads and writes, with changes replicated asynchronously (typically within a second or so). For globally distributed apps and Region-level resilience.

Other features

Feature Use
TTL Automatically delete expired items (sessions, temporary data) at no cost
Transactions ACID operations across multiple items/tables
Point-in-time recovery Restore to any second in the last 35 days
On-demand backups Full backups kept until deleted
Export to S3 Analyse with Athena without consuming table capacity
Standard-IA table class Lower storage cost for rarely accessed tables
Encryption Always at rest; choose key type
Gateway VPC endpoint Private access from VPCs, free

When DynamoDB fits (and doesn't)

Good fit Poor fit
Known access patterns by key Ad-hoc queries, complex joins, reporting
Massive scale, unpredictable traffic Heavy relational integrity across many tables
Serverless apps, sessions, carts, gaming, IoT, metadata Analytics over the whole dataset (use Athena/Redshift on exports)

Exam patterns

Bipin Singh
Written by Bipin Singh

Senior Full-Stack Engineer · AI & AWS. I design and run production systems on AWS — serverless, data and AI.

Work with me