Skip to content
Tutorials Center
My learning

Topics

Amazon DynamoDB Tutorial

Learn Amazon DynamoDB step by step: 37 lessons in 9 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Is Amazon DynamoDB? Learn what Amazon DynamoDB is, how a serverless key-value and document database works, what it is good at, and when you should pick something else.
  2. 2 Tables, Items and Attributes Understand the three building blocks of DynamoDB: tables, items and attributes, how they compare to rows and columns, and what a table schema really fixes.
  3. 3 Your First Table: Console and CLI Create a DynamoDB table in the AWS console and with the AWS CLI, write and read your first items, and see what each command and its JSON mean.
  4. 4 DynamoDB vs Relational Databases Compare DynamoDB with SQL databases: schema, joins, queries, scaling, transactions and cost, and learn when each approach is the right choice.

Data Model and Keys

  1. 5 Attribute Data Types Learn every DynamoDB data type: string, number, binary, boolean, null, list, map and the three set types, plus the type rules for key attributes.
  2. 6 Primary Keys: Partition Key and Sort Key Understand simple and composite primary keys in DynamoDB, how the partition key and sort key work together, and how keys decide which queries are possible.
  3. 7 How DynamoDB Partitions Your Data See how DynamoDB spreads items over partitions with a hash of the partition key, how partitions split, the per-partition limits, and what adaptive capacity does.
  4. 8 Choosing Good Partition Keys Learn how to pick a DynamoDB partition key: high cardinality, even access, composite values, write sharding for hot keys, and a checklist of keys to avoid.
  5. 9 Item Size and Service Limits Learn how DynamoDB measures item size, the 400 KB item limit, key and attribute name rules, request limits, and patterns for storing data that does not fit.

Reading and Writing Items

  1. 10 PutItem and GetItem Master the two basic DynamoDB operations: PutItem to create or replace an item and GetItem to read one by key, with consistency, projections and CLI and SDK examples.
  2. 11 UpdateItem and Update Expressions Change items in place with UpdateItem: SET, REMOVE, ADD and DELETE actions, if_not_exists and list_append, atomic counters, nested paths and upsert behavior.
  3. 12 DeleteItem and ReturnValues Delete items with DeleteItem, understand why deletes are idempotent, get the old item back with ReturnValues, delete a whole collection safely, and use soft deletes.
  4. 13 Condition Expressions and Conditional Writes Use condition expressions to make writes safe: attribute_not_exists, comparisons, begins_with, contains, size, optimistic locking with a version attribute, and error handling.
  5. 14 BatchGetItem and BatchWriteItem Read and write many items in fewer round trips with BatchGetItem and BatchWriteItem: limits, partial failures, unprocessed items, backoff and when to use transactions.

Queries, Scans and Indexes

  1. 15 The Query Operation Learn the DynamoDB Query operation: key condition expressions, sort key operators, ScanIndexForward, Limit, Select COUNT and why Query is the workhorse of every design.
  2. 16 Filters, Projections and Pagination Understand DynamoDB filter expressions (applied after reading), projection expressions, ScannedCount vs Count, the 1 MB page limit and LastEvaluatedKey pagination.
  3. 17 The Scan Operation and Parallel Scan Learn what Scan does, why it is expensive, when it is acceptable, how parallel scan with segments works, and the better alternatives: indexes, exports and design changes.
  4. 18 Global Secondary Indexes (GSI) Add alternate query paths with global secondary indexes: key schema, projection types, eventual consistency, separate capacity, sparse indexes, backfill and costs.
  5. 19 Local Secondary Indexes (LSI) Learn local secondary indexes: same partition key, alternate sort key, strong consistency, create-at-table-time rule, 10 GB collection limit, and how an LSI compares with a GSI.

Data Modeling Patterns

  1. 20 Design From Access Patterns Learn the DynamoDB way to model data: list every question your app asks, then shape keys and indexes to answer each one with a single Query call.
  2. 21 Single-Table Design Store several entity types in one DynamoDB table with generic PK and SK attributes, fetch related items in one Query, and learn when multiple tables are fine.
  3. 22 Relationships With Adjacency Lists Model one-to-one, one-to-many and many-to-many relationships in DynamoDB with embedding, shared partition keys, the adjacency list pattern and an inverted index.
  4. 23 Hot Partitions and Write Sharding Understand why uneven DynamoDB keys cause throttling, how partition limits work, and how to fix hot keys with write sharding and scatter-gather reads.

Capacity, Consistency and Transactions

  1. 24 Capacity Modes: On-Demand and Provisioned Calculate DynamoDB read and write capacity units, compare on-demand and provisioned modes, use auto scaling and reserved capacity, and avoid throttling.
  2. 25 Consistency Models Learn how DynamoDB replicates data across Availability Zones, when eventually consistent reads return stale data, and when to choose strong consistency.
  3. 26 Conditional Writes and Optimistic Locking Use DynamoDB condition expressions to insert only if absent, guard state changes, and implement optimistic locking with a version attribute and retry loop.
  4. 27 Transactions Group up to 100 DynamoDB actions in an all-or-nothing transaction with TransactWriteItems, learn the limits, costs, idempotency tokens and when to avoid them.

Streams, TTL and Integrations

  1. 28 DynamoDB Streams Capture every insert, update and delete in a DynamoDB table with Streams: view types, shards, ordering guarantees, 24-hour retention and common consumer patterns.
  2. 29 Time to Live (TTL) Delete expired DynamoDB items automatically with Time to Live: the epoch-seconds attribute, background deletion delay, filtering expired reads and streams.
  3. 30 Integrations With Lambda, Kinesis and S3 Connect DynamoDB to AWS Lambda, EventBridge Pipes, Kinesis Data Streams, OpenSearch and S3 exports to build event-driven apps, search indexes and analytics.
  4. 31 Backups, PITR and Global Tables Protect DynamoDB data with on-demand backups, point-in-time recovery and AWS Backup, and replicate across Regions with global tables, conflicts and failover.

SDKs and Local Development

  1. 32 AWS CLI and SDKs Call DynamoDB from the AWS CLI, Python boto3 and the JavaScript SDK v3: low-level versus document clients, attribute type descriptors, pagination, retries and errors.
  2. 33 Local Development and Testing Develop and test DynamoDB code offline with DynamoDB Local in Docker, an endpoint override, fakes and repositories, table setup in tests and what Local cannot do.
  3. 34 Infrastructure as Code and IAM Define DynamoDB tables as code with CloudFormation, CDK or Terraform, and secure them with least-privilege IAM policies, leading-key conditions and encryption.

Projects and Practice

  1. 35 Project: Order Management System Build an order management data model in DynamoDB step by step: access patterns, single-table keys, a status index, stock transactions and a runnable stand-in.
  2. 36 Project: Leaderboard and Sessions Model a game backend in DynamoDB: a top-N leaderboard with a sort-key index, sharded score buckets, expiring sessions with TTL and safe counters, with runnable stand-ins.
  3. 37 Practice: Design Challenges Practice DynamoDB design with worked challenges: chat, blog comments, multi-tenant SaaS, IoT readings and cost estimates, plus common interview questions.