DynamoDB Deep Dive

How Amazon DynamoDB stores and serves data, and how to design for it: keys and partitions, capacity units, hot keys, access-pattern modeling, secondary indexes, conditional writes and transactions, streams, TTL and global tables.

Overview

Amazon DynamoDB is AWS's fully managed key-value and document database. You create a table, choose its key, and read and write items through an API; AWS runs the servers, splits the data across partitions, replicates it across Availability Zones and scales it. It launched in 2012 and is built for predictable performance at any size: AWS reports that on Prime Day 2025, Amazon's own systems drove DynamoDB to a peak of 151 million requests per second.

The price of that predictability is that DynamoDB does very few things, and does them fast. There are no joins and no ad hoc query planner. Almost every efficient read is a lookup or a range scan on one partition key. So designing for DynamoDB means listing your access patterns first and shaping keys and indexes to fit them, which is the opposite of the relational habit of modeling the data first and writing queries later.

Interviewers use DynamoDB to test exactly that skill, along with capacity math, hot-key handling and consistency choices. This chapter covers each, with the limits that shape the design taken from AWS's own documentation.

What you will be able to do

  • Explain how a request reaches its partition, and what strong and eventual reads cost and promise.
  • Size a table in read and write units, and choose on-demand or provisioned capacity.
  • Spot a hot partition and fix it with better keys or write sharding.
  • Model a feature from its access patterns, with GSIs, LSIs and single-table design where they fit.
  • Use conditional writes, transactions, Streams, TTL and global tables correctly, including their limits.

Key concepts

  • Partition key and sort key
  • Item collections
  • Replication groups and leaders
  • RCUs and WCUs
  • On-demand vs provisioned
  • Hot partitions and write sharding
  • Single-table design
  • GSI vs LSI
  • Conditional writes and transactions
  • Streams, TTL and global tables

Interview questions

  • How does DynamoDB partition and replicate data?
  • Size a table: 2,000 reads per second of 6 KB items and 500 writes per second of 2.5 KB items.
  • What is a hot partition, and how do you fix one?
  • Walk through how you would model a feature in DynamoDB.
  • Compare GSIs and LSIs.
  • How do you prevent lost updates and keep invariants across items?
  • How do global tables work, and which mode would you choose?
  • How would you build search or analytics on top of DynamoDB?

Sign up free to read the full topic

More System Design topics

Start free on Cariara · Coding problems · System design studio