What Is DynamoDB
A Note on Sources
Most of what's public about DynamoDB's actual internals (as opposed to its API contract) comes from one primary source: Elhemali et al., "Amazon DynamoDB: A Scalable, Predictably Performant, and Fully Managed NoSQL Database Service," USENIX ATC 2022 — the ten-years-later paper the DynamoDB team wrote themselves. It is not the original 2007 Dynamo paper (Werner Vogels et al., SOSP 2007). This distinction matters more than it looks: DynamoDB is not a productized version of Dynamo. Dynamo was a leaderless, gossip-based, eventually-consistent internal Amazon library with a pluggable storage engine (Berkeley DB, MySQL, or in-memory). DynamoDB, launched in 2012, is a from-scratch rewrite that borrowed the name and a few ideas (consistent hashing, partition-based sharding) but made the opposite choice on the most important axis: it is leader-based, not leaderless. Keep this straight — it's the single most common staff-interview trap in this space, and it's also the answer to the Central Question.
Where this guide states an internal mechanism as fact, it is sourced from the USENIX paper, AWS's own engineering blog, or AWS documentation. Where AWS has not published a detail (e.g., the exact hash function used for partition key hashing), this guide says so explicitly rather than guessing.
The One-Line Definition
DynamoDB = fully managed, partition-based, hash-and-range key-value store with an intentionally minimal query surface.
Three words carry the weight:
| Word | Meaning |
|---|---|
| Fully managed | No servers, no node sizing, no compaction tuning, no repair scheduling, no OS patching. AWS operates the fleet; you operate the schema and the access patterns |
| Partition-based | Every table is sharded by hashing a partition key. A given key always resolves to exactly one partition, which is served by exactly one small (3-6 node) replication group |
| Minimal query surface | GetItem, PutItem, Query (single partition, optional sort-key range), Scan (full table, explicitly discouraged for production paths), and TransactWriteItems/TransactGetItems. No JOIN. No arbitrary WHERE on non-indexed attributes. No query planner, because there is no query to plan — every Query call already names the exact partition it will hit |
The mental model that unlocks everything: DynamoDB is not a database that happens to be fast — it is a database that is fast because it refuses to be a database that lets you write a slow query. Every other design decision in this guide is downstream of that refusal.
How It Compares to Other Stores
| Store | Data organization | Query model | Where latency comes from |
|---|---|---|---|
| Relational (Postgres) | Fixed-schema rows, arbitrary indexes | Full SQL: joins, aggregates, ad-hoc WHERE |
Query planner cost, index selectivity, lock contention |
| Wide-column, leaderless (Cassandra) | Partition-sorted rows, hash-distributed | WHERE partition_key = ? mandatory; secondary indexes exist but are a known trap |
Quorum round-trips, compaction interference, tombstone scans |
| Wide-column, leader-based (DynamoDB) | Partition + sort key, hash-distributed | Query on one partition; Scan for everything else (explicitly the escape hatch, not a feature) |
Almost none — the query model forbids the operations that would introduce it |
| Document (MongoDB) | Flexible JSON documents | Rich query language, secondary indexes, aggregation pipeline | Index selection, working-set size vs. RAM |
Where DynamoDB Fits
| Workload | Why It Fits | Key Access Pattern |
|---|---|---|
| High-scale operational lookups | User profiles, session state, shopping carts, feature flags — always fetched by a known key | GetItem(pk) |
| Time-ordered per-entity history | Order history for a customer, message history for a conversation | Query(pk=customer_id, sk begins_with "ORDER#") |
| Serverless / event-driven backends | Pay-per-request billing, zero idle cost, scales to zero and to millions of RPS without capacity planning | Lambda + DynamoDB is the default AWS serverless data-tier pairing |
| Massive predictable-latency workloads | Ad tech bidding, gaming leaderboards/session state, IoT device shadows — anywhere a p99 latency SLA is a hard product requirement, not a nice-to-have | Single-digit ms reads regardless of table size |
Where DynamoDB Is the Wrong Answer
DynamoDB vs. Cassandra: Same Lineage, Opposite Replication Model
Both systems descend conceptually from the 2007 Dynamo paper — consistent hashing, partition-based horizontal scale, tunable trade-offs. That's where the similarity ends, and the difference is the single most important thing a staff engineer needs to know cold:
| Cassandra | DynamoDB | |
|---|---|---|
| Replication | Leaderless — any replica accepts any write, coordinator forwards to all N, waits for W acks | Leader-based — one replica per partition is the Multi-Paxos-elected leader; writes go through it |
| Consistency mechanism | Achieved per-request via quorum overlap math (R + W > N) plus asynchronous read-repair | Achieved structurally — ask the leader and you get the truth, no comparison needed |
| Membership/coordination | Gossip protocol, no external coordinator | Multi-Paxos per replication group, plus a central metadata service (MemDS, Partitioning and Request Routing) |
| Query flexibility | More flexible — secondary indexes, ALLOW FILTERING, multi-partition queries (all discouraged, all possible) |
Deliberately less flexible — no equivalent escape hatches beyond Scan |
| Ops model | Self-managed (or DataStax Astra) — you own compaction strategy, repair scheduling, vnode tuning | Fully managed — AWS owns 100% of the operational surface |
| Where it wins | Extreme scale where self-managed ops cost less than AWS per-request pricing; multi-cloud/on-prem requirement | Everywhere the operational burden of running Cassandra correctly outweighs its flexibility |
This table is the setup for the Storage Engine and Replication part — it's worth committing the leader-based/leaderless distinction to memory before proceeding, because nearly every later section's mechanics trace back to it.
Capacity Modes: Provisioned vs. On-Demand
Every table runs in one of two billing/throughput modes, and the choice interacts directly with Adaptive Capacity and Hot Partitions's adaptive capacity story:
| Provisioned | On-Demand | |
|---|---|---|
| How capacity is set | You declare RCU/WCU per table (and per GSI); auto-scaling can adjust it within minutes based on a target utilization | No declaration — DynamoDB scales automatically to whatever the workload sends, per request, billed per request |
| Cold-start behavior | Fixed capacity from the start; safe against sudden 0→huge spikes only within the last-seen traffic's "double" rule (below) | Handles roughly double the previous traffic peak instantly; a workload that spikes far beyond 2× its recent high-water mark can still throttle until DynamoDB's internal capacity catches up |
| Cost model | Cheaper at steady, predictable, high utilization | Cheaper at spiky, unpredictable, or low-average utilization — no idle-capacity waste |
| Per-partition ceiling (see Adaptive Capacity and Hot Partitions) | Same hard 3,000 RCU / 1,000 WCU per partition | Identical ceiling — on-demand does not change the physical limit of what one partition's replication group can sustain, it only changes how the table's aggregate budget is billed and pre-provisioned |
DAX: The Caching Layer That Sits in Front of All of This
DynamoDB Accelerator (DAX) is a separate, optional, in-memory caching tier that sits between your application and DynamoDB, API-compatible with the DynamoDB SDK. It exists because even single-digit-millisecond DynamoDB latency is too slow for some read-heavy, latency-critical paths (ad bidding, gaming) that want sub-millisecond reads. DAX caches at two levels — an item cache (recent GetItem/Query/Scan results) and a query cache (recent query/scan request+response pairs) — each with an independent, configurable TTL (default 5 minutes).
The consequence worth internalizing now and revisiting in the Consistency Model part: DAX read consistency is a third tier, weaker than DynamoDB's own eventual consistency. A DAX item-cache hit can be as stale as its TTL, regardless of what consistency level you requested from DynamoDB itself — asking DAX for a "strongly consistent" read bypasses the cache entirely and goes straight to DynamoDB (correct behavior), but an eventually-consistent read through DAX can be stale by minutes, not milliseconds, if the underlying item hasn't been touched recently enough to have expired from cache. Teams that reach for DAX purely for latency and don't think through this staleness ceiling have shipped read-your-writes bugs that DynamoDB's own eventual consistency (bounded to milliseconds, The Consistency Model) would never have produced on its own.