📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials AWS Solutions Architect DynamoDB — NoSQL Database

DynamoDB — NoSQL Database

4 min read Quiz at the end
Understand DynamoDB's key-value model, partition keys, GSIs, DAX caching, and when to choose NoSQL over relational databases.

DynamoDB — Serverless NoSQL at Any Scale

DynamoDB is AWS's fully-managed NoSQL database that delivers single-digit millisecond response times at ANY scale — from 1 request per second to millions. You never provision servers or manage capacity.

Teacher Note: RDS is like a structured spreadsheet — tables with fixed columns, perfect for related data. DynamoDB is like a folder of JSON files — flexible structure, perfect for high-speed lookups when you know exactly what you're searching for.

DynamoDB Key Concepts

ConceptExplanationExample
TableCollection of items (like a database table)orders, users, products
ItemA single record (like a row)One specific order
AttributeA field on an item (like a column)order_id, user_id, total_price
Partition KeyPrimary key — determines which partition stores the itemorder_id
Sort KeyOptional secondary key — orders items within a partitioncreated_at
GSIGlobal Secondary Index — query on any non-key attributeQuery orders by user_id

Capacity Modes

ModeHow it WorksBest For
On-DemandPay per request — zero capacity planningUnpredictable or new workloads
ProvisionedSet RCU and WCU — auto-scaling availablePredictable workloads (cheaper at scale)

DynamoDB Accelerator (DAX)

DAX is an in-memory cache for DynamoDB that reduces read latency from milliseconds to MICROSECONDS — using the exact same DynamoDB API. No code changes in your application.

DynamoDB Streams

DynamoDB Streams captures every change (insert, update, delete) to items in real-time. Connect to Lambda to trigger actions when data changes — perfect for event-driven architectures.

Exam Tip: When to choose DynamoDB over RDS: you need millisecond latency at massive scale, your data is key-value or document structure, you cannot predict traffic volume. When to choose RDS: you need complex SQL joins, transactions across many tables, reporting queries, or existing SQL-based applications.
Topic Quiz · 2 questions

Test your understanding before moving on

1. A mobile application needs to store user session data and retrieve it in under 1 millisecond at massive scale. Which database is BEST?
💡 DynamoDB with DAX (in-memory cache) provides microsecond latency for read-heavy workloads at any scale.
2. Why is choosing the right partition key in DynamoDB critical?
💡 The partition key determines data distribution across DynamoDB's physical shards. Poor partition keys (like storing everything under one key) cause hot partitions and throttling.