Amazon DynamoDB Course Home
This course takes you from your first DynamoDB table to production-grade designs used by high-traffic serverless systems.
Introduction
This course takes you from your first DynamoDB table to production-grade designs used by high-traffic serverless systems. You will model a real e-commerce workload — customers, orders, order lines, and products — in a single table, query it efficiently with secondary indexes, react to changes with Streams and Lambda, and protect it with transactions, IAM, and backups.
DynamoDB rewards a different way of thinking than relational databases: you design around access patterns first, then choose keys that make each pattern a single, cheap request. Every module builds on the same ShopTable so the design decisions accumulate the way they do on a real team.
Purpose of this lesson
Use this page to understand the roadmap, set up a local environment, and decide where to start. Each lesson ends with a hands-on task and interview questions so you can check your understanding before moving on.
Understanding the topic
The six modules:
- Module 1 · Foundations & Partition Keys — tables, items, keys, partitions, CRUD, and choosing partition keys that spread load.
- Module 2 · Single-Table Design & Access Patterns — access-pattern-first modeling, item collections, one-to-many and many-to-many relationships, time series.
- Module 3 · GSI/LSI & Query Optimization — capacity and consistency, Query vs Scan, global and local secondary indexes, sparse indexes, pagination.
- Module 4 · DynamoDB Streams & Lambda Triggers — change data capture, stream processing with Lambda, TTL expiry events, outbox-style integration.
- Module 5 · Transactions & Global Tables — conditional writes, optimistic locking, ACID transactions, batch operations, multi-Region replication.
- Module 6 · Security, Backup & Interview Prep — IAM fine-grained access, encryption, PITR and restores, monitoring, cost, and interview practice.
Step-by-step explanation
- Read Module 1 in order — partition keys drive every later decision.
- Write down the access patterns for your own app before Module 2; you will model them as you go.
- Keep DynamoDB Local running and paste each lesson's code into a scratch project.
- Finish each lesson's hands-on task before reading the interview questions.
- Use Module 6's interview lesson as a final review across the whole course.
Syntax reference
Local setup. Run DynamoDB Local in Docker and point the AWS CLI at it, so you can practise without an AWS bill:
# Start DynamoDB Local (in-memory, port 8000)docker run --rm -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -inMemory -sharedDb# Dummy credentials are fine for DynamoDB Localexport AWS_ACCESS_KEY_ID=local AWS_SECRET_ACCESS_KEY=local AWS_REGION=us-east-1# Create the course tableaws dynamodb create-table \--endpoint-url http://localhost:8000 \--table-name ShopTable \--attribute-definitions AttributeName=PK,AttributeType=S AttributeName=SK,AttributeType=S \--key-schema AttributeName=PK,KeyType=HASH AttributeName=SK,KeyType=RANGE \--billing-mode PAY_PER_REQUESTaws dynamodb list-tables --endpoint-url http://localhost:8000
Output
{
"TableNames": [
"ShopTable"
]
}Informative example
The SDK client used throughout the course (AWS SDK for JavaScript v3 with the Document client, which converts plain JavaScript values to DynamoDB types):
// npm install @aws-sdk/client-dynamodb @aws-sdk/lib-dynamodbimport { DynamoDBClient } from "@aws-sdk/client-dynamodb";import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";const client = new DynamoDBClient({region: "us-east-1",// Remove endpoint to talk to real AWS.endpoint: process.env.DYNAMODB_ENDPOINT ?? "http://localhost:8000",});export const ddb = DynamoDBDocumentClient.from(client, {marshallOptions: { removeUndefinedValues: true },});export const TABLE = "ShopTable";
Best practices
- Practise on DynamoDB Local or a sandbox AWS account with on-demand billing and a budget alarm.
- Keep a written access-pattern list next to every table you design.
- Use the Document client so code works with plain JavaScript objects instead of attribute-value maps.
Common mistakes
- Designing tables like relational schemas (one table per entity, joins in application code).
- Skipping partition-key design because a small dataset seems fast — problems appear only at scale.
Advanced interview questions
Interview Prep
Practice concise answers, then expand each card for the explanation.
1BeginnerQuestionWhen is DynamoDB a good fit, and when is it not?+
Answer
2IntermediateQuestionWhy does DynamoDB modeling start with access patterns?+
Answer
Hands-on exercise
Set up your lab: start DynamoDB Local, create ShopTable with the command above, and run aws dynamodb describe-table --table-name ShopTable --endpoint-url http://localhost:8000. Confirm that KeySchema lists PK as HASH and SK as RANGE.
Summary
The course follows one e-commerce table through six modules: foundations, single-table design, indexes, streams, transactions and global tables, and production operations.