Amazon DynamoDB: Access-Pattern Modeling and Cost

Single-table design, conditional writes and capacity - where the schema is derived from the queries and the bill is part of the design.

Taught by Noshad Alam 7 lessons 49 min Published 30 Nov 2026

DynamoDB gives you single-digit millisecond latency at any scale, with no servers to manage, and it asks one thing in return: **you must know your access patterns before you design the schema.** That requirement is not a style preference - it is structural. A DynamoDB table has a primary key and a small number of secondary indexes, and a query must specify a partition key. If a query you need was not anticipated, there may be no efficient way to answer it, and the fix is a new index or a migration rather than a new `WHERE` clause.

Overview

This inverts how most people were taught to design. In a relational database you model the entities, normalise, and query however you like afterwards. Here you **list the access patterns first**, then derive a key schema that serves them, and the result frequently looks nothing like an entity model - several entity types in one table, generic attribute names like `PK` and `SK`, and an item collection that returns an order and its lines and its payments in a single query. That is **single-table design**, it is the idiomatic approach, and it looks wrong until the moment it clicks.

The second subject running through the course is **cost**, and it is a first-class engineering constraint rather than an afterthought. DynamoDB bills read and write capacity units, storage, index writes, stream reads and data transfer. A `Scan` where a `Query` would do is not merely slow - it reads and bills for every item in the table. An index you added "just in case" is a write cost on every item that matches it. The course teaches cost modelling as a design activity, because a DynamoDB design you cannot price is a design you have not finished.

Seven modules, about 80 hours. The capstone is a shopping cart and order status service with conditional updates and a full cost model.

Introduction

This course assumes the programme's shared foundations. It does not assume SQL, and if you know SQL well you will spend Module 2 deliberately setting aside habits that are correct everywhere else.

For a sandbox, use **DynamoDB Local** - `amazon/dynamodb-local` in Docker, or the Java archive - for everything you can. It is free, offline, resets instantly, and supports the full API surface including transactions and indexes. What it does not give you: real latency, real throttling behaviour, adaptive capacity, Streams integration with Lambda, or a bill. Modules 4, 5 and 6 need a real AWS account; the free tier covers the course comfortably if you clean up after yourself, and the laboratory instructions include teardown steps for that reason.

Examples use the **AWS SDK for JavaScript v3** with the `DocumentClient`, which maps JavaScript values to DynamoDB's typed attribute format so you do not write `{"S": "value"}` by hand. The CLI is used where it is clearer.

One habit from the first module: **write your access patterns down, in a list, before you create a table.** Not in your head - in a file, numbered, with the key condition each one will use. That list is the schema's specification, it is the thing you review, and every laboratory in this course refers back to it.

What you will be able to do

  • Use the console, CLI and SDK, and run DynamoDB Local for development
  • Explain items, attributes, partition keys and sort keys, and the limits on each
  • Write an access pattern list and derive a key schema from it
  • Explain single-table design, and build an item collection that serves several patterns
  • Distinguish Query from Scan, and state the cost of each precisely
  • Choose between a GSI and an LSI, and name what each cannot do
  • Paginate correctly, including through a filtered result set
  • Use conditional writes for optimistic locking and idempotency
  • Explain eventual against strong consistency and their different costs
  • Use transactions, and state what they cost and what they cannot do
  • Consume DynamoDB Streams and build an idempotent consumer
  • Choose between on-demand and provisioned capacity with a reason
  • Identify a hot partition and explain what adaptive capacity does
  • Diagnose throttling, and distinguish it from a capacity shortfall
  • Calculate read and write capacity units from item sizes
  • Configure global tables, point-in-time recovery, backups and export
  • Use TTL for expiry, and explain its delay
  • Implement least privilege IAM, including item-level conditions
  • Produce a cost model that predicts the bill before it arrives

What each level covers

5 levels · 7 lessons

  1. Beginner - Foundations

    The key schema and the limits; then the access-pattern discipline the whole course rests on.

    2 lessons 13 min of reading

    Start with Tables, Keys, Items and the Local Emulator →
  2. Intermediate - Application Behaviour

    Conditional writes and transactions, the consistency choice, and Streams.

    1 lesson 8 min of reading

    Start with Conditional Writes, Transactions, Consistency and Streams →
  3. Advanced - Performance and Reliability

    Capacity, hot partitions and throttling; then global tables, recovery and TTL.

    2 lessons 13 min of reading

    Start with Capacity Modes, Hot Partitions, Throttling and Cost →
  4. Expert - Security and Production Architecture

    IAM at item level, encryption, private networking and the quotas that bound a design.

    1 lesson 8 min of reading

    Start with IAM, KMS, VPC Endpoints, Monitoring and Quotas →
  5. Capstone

    One cart and order service, defended on access patterns, conditional correctness, measured capacity and a predicted bill.

    1 lesson 7 min of reading

    Start with Capstone - Shopping Cart and Order Status Service →

Guides and articles

Longer reading about this subject, written alongside the course.

Course guide How to work through this course Why the access pattern list comes first, the two numbers to watch, what to unlearn, and what to skip. 3 min read

Before you start

  • An AWS account (the free tier is sufficient)
  • DynamoDB Local in Docker, and the AWS CLI v2
  • Node.js 20 or later with the AWS SDK v3
  • The programme's shared foundations

Common questions

What does the Amazon DynamoDB: Access-Pattern Modeling and Cost course cover?
It is 5 levels and 7 lessons: Beginner - Foundations; Intermediate - Application Behaviour; Advanced - Performance and Reliability; Expert - Security and Production Architecture; Capstone. Each level ends with a quiz, and the last one is an exam over the whole course.
How long does it take?
About 49 minutes of reading and exercises - roughly 0.8 hours. It is self-paced with no cohort and no start date, so you can leave and come back and the site remembers where you were.
What do I need to know first?
An AWS account (the free tier is sufficient). DynamoDB Local in Docker, and the AWS CLI v2. Node.js 20 or later with the AWS SDK v3. The programme's shared foundations.
Is it free?
Yes. Every lesson, example and quiz in this course is free to read, and you do not need an account to read them. Signing in only adds progress tracking and quiz results.
What will I be able to do afterwards?
Use the console, CLI and SDK, and run DynamoDB Local for development. Explain items, attributes, partition keys and sort keys, and the limits on each. Write an access pattern list and derive a key schema from it. Explain single-table design, and build an item collection that serves several patterns. Distinguish Query from Scan, and state the cost of each precisely. Choose between a GSI and an LSI, and name what each cannot do. Paginate correctly, including through a filtered result set. Use conditional writes for optimistic locking and idempotency. Explain eventual against strong consistency and their different costs. Use transactions, and state what they cost and what they cannot do. Consume DynamoDB Streams and build an idempotent consumer. Choose between on-demand and provisioned capacity with a reason. Identify a hot partition and explain what adaptive capacity does. Diagnose throttling, and distinguish it from a capacity shortfall. Calculate read and write capacity units from item sizes. Configure global tables, point-in-time recovery, backups and export. Use TTL for expiry, and explain its delay. Implement least privilege IAM, including item-level conditions. Produce a cost model that predicts the bill before it arrives.