Skip to main content
← PROBLEMS / SYSTEM-DESIGN
An end-to-end domain learning journey

Eliminating DynamoDB
Hot-Partition Throttling.

To eliminate DynamoDB's 1,000 WCU/3,000 RCU per-partition ceiling for celebrity merchants, append a bounded shard suffix (MERCHANT#<id>#<0..N-1>) for high-volume writes, scatter-gather top-K reads, and cache hot reads in DAX/Redis.
Start the journey5 stages
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

When traffic spikes expose hidden coupling, use adaptive write sharding (N shards only for celebrity merchants) to spread writes past 1,000 WCU/partition, and pair with scatter-gather reads + short-TTL caching.

TL;DR30-second simplified summary
▾

Core Mechanics: DynamoDB provisions capacity across physical partitions, but each individual physical partition is hard-capped at 1,000 WCU/sec, 3,000 RCU/sec, and 10 GB.

Visual & Structural Flow: Depicts Spreading 5,000 WCU & 25,000 RCU Across N=8 Physical Partitions (Shard #0-1 -> Shard #2-3 -> Shard #4-5 -> Shard #6-7 -> M1#0); Adaptive Suffix Writer + Redis/DAX Cache + N-Shard Scatter-Gather (Payment API -> DAX / Redis -> Scatter-Gather -> DynamoDB (N)).

Trade-Offs & Production: Two common reactions fail to fix the bottleneck: Raising Table WCU to 50,000: Does nothing for a single hot key still capped at 1,000 WCU. Production DynamoDB architectures combine three patterns: Adaptive Write Sharding: Lookup shard_count in a cached config (N=1 for normal merchants, N=8 or 16 for celebrity merchants).

Failure Modes & Application: Write sharding with bounded scatter-gather is the standard remedy for single-key hotspots: Payment Ledgers & Flash-Sale Counters: Distributing celebrity merchant or viral SKU writes across N partitions.

Full walkthrough · 5 stages
01
STAGE 01 · WHY IT MATTERSL4 · FUNDAMENTALS

Why DynamoDB hot-partition throttling happens at 12% table utilization.

Why this matters: The mechanism: understand how Why DynamoDB hot-partition throttling happens at 12% table utilization works from first principles.

Think of Why DynamoDB hot-partition throttling happens at 12% table utilization as the intuition layer for Eliminating DynamoDB Hot-Partition Throttling: The mechanism: understand how Why DynamoDB hot-partition throttling happens at 12% table utilization works from first principles.

DynamoDB provisions capacity across physical partitions, but each individual physical partition is hard-capped at 1,000 WCU/sec, 3,000 RCU/sec, and 10 GB. When PK = MERCHANT#<merchant_id> receives 3,500 writes/sec (3,500 WCU) and 12,000 reads/sec (12,000 RCU) for one celebrity merchant, that single partition throttles with ProvisionedThroughputExceededException even though the table's 10,000 WCU total is only 12% utilized.

02
STAGE 02 · IMPACTL5 · APPLIED DESIGN

What happens without write sharding and read caching.

Why this matters: The problem: see what breaks without What happens without write sharding and read caching under real concurrency or scale.

Leaving a skewed PK = MERCHANT#<id> unsharded triggers three cascading failures:

  1. Hard Partition Throttling: 3,500 WCU > 1,000 WCU ceiling drops ~71% of writes.
  2. SDK Retry Amplification: Default exponential retries pile up on the same hot partition, turning a spike into a sustained outage.
  3. Adaptive Capacity Limits: Even DynamoDB adaptive capacity cannot exceed the 1,000 WCU single-partition physical ceiling.
Hot Partition vs. Sharded Keyspace

Spreading 5,000 WCU & 25,000 RCU Across N=8 Physical Partitions

1. Hash Ring, Clockwise Lookup & Replication
clockwisehash(PK # 0..7)~625 WCU / shardShard #0-1Shard #2-3Shard #4-5Shard #6-7M1#3PrimaryReplica (next physical)
2. Virtual Nodes (Even Arc Distribution)
Vnodes / Server150–256 tokens eachM1#0M1#1M1#2M1#3M1#4M1#5M1#6M1#7
Engineering Decision Framework
Problem
How to implement Eliminating DynamoDB Hot-Partition Throttling without hitting unbounded tail latency, state divergence, or operational fragility.
Naive Solution
Use a single unpartitioned path with unbounded retries and synchronous global coordination.
Why It Fails
Global coordination serializes throughput under load, while unbounded retries amplify transient stalls into full outages.
Alternatives
Compare synchronous strict-consistency paths against bounded asynchronous replication, local caching, or partitioned ownership.
Engineering Decision
When traffic spikes expose hidden coupling, use adaptive write sharding (N shards only for celebrity merchants) to spread writes past 1,000 WCU/partition, and pair with scatter-gather reads + short-TTL caching.
Trade-Offs
Gains predictable p99 latency and fault isolation in exchange for explicit bounding, observability, and slightly higher implementation complexity.
Decision Exercise · Make the Call

When Eliminating DynamoDB Hot-Partition Throttling experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?

03
STAGE 03 · NAIVE SOLUTIONL5 · APPLIED DESIGN

Naive solution (and why over-provisioning table WCU or sharding everyone fails).

Why this matters: The problem: see what breaks without Naive solution under real concurrency or scale.

Two common reactions fail to fix the bottleneck:

  • Raising Table WCU to 50,000: Does nothing for a single hot key still capped at 1,000 WCU.
  • Fixed 20-Shard Suffix for All Merchants: Forces 20 parallel Query calls for small merchants who only do 2 writes/sec, wasting 20× read overhead.
Request & State Flow

Naive solution (and why over-provisioning table WCU or sharding everyone fails)

Client TxPlanner / Lock MgrWAL / MemTableHeap / SSTable1. Acquire snapshot / index plan2. Append redo record + fsync WAL3. Flush dirty pages / compactSSTables4. Commit & release row locks
04
STAGE 04 · ENTERPRISE SOLUTIONL6 · SCALE & TRADE-OFFS

Enterprise solution: Adaptive Write Sharding + Scatter-Gather Top-50 + Cache.

Why this matters: Operational control: configure bounds, failure handling, and safe production defaults.

Production DynamoDB architectures combine three patterns:

  • Adaptive Write Sharding: Lookup shard_count in a cached config (N=1 for normal merchants, N=8 or 16 for celebrity merchants). Writers pick suffix = random(0, N-1) -> PK = MERCHANT#<id>#<suffix>, keeping each partition around ~625 WCU at 5,000 WCU total.
  • Parallel Scatter-Gather Top-50: To fetch the latest 50 transactions (SK = TX#<ts>#<tx_id>), issue N async Query(..., ScanIndexForward=False, Limit=50) calls and k-way merge the top 50 in < 25 ms p95.
  • Read Cache + Bounded Retries: Serve 25,000 reads/sec from DAX/Redis (5–10 s TTL) and cap SDK retries with jitter + circuit breaker.
Sharded Write & Cached Read Path

Adaptive Suffix Writer + Redis/DAX Cache + N-Shard Scatter-Gather

Payment APIReads shard_count=NDAX / Redis25k/s read absorbScatter-GatherN async QueriesDynamoDB (N)625 WCU / partition

1.Adaptive Suffix: Normal merchants use N=1; celebrity merchants scale to N=8..16.

2.Scatter-Gather: Queries N shards in parallel with Limit=50 and heap-merges top 50.

3.DAX / Redis: Absorbs 25,000 reads/sec well below the 3,000 RCU/partition ceiling.

4.Contributor Insights: Detects emerging hot keys early to bump N before throttling.

Adaptive sharding + DAX/Redis caching sustains 5k WCU and 25k RCU for a single merchant without over-sharding small tenants.

import random, asyncio
from heapq import merge

SHARD_MAP = {"celebrity_m1": 8}  # loaded from dynamic config / Redis

def write_tx(ddb, merchant_id: str, ts_iso: str, tx_id: str, payload: dict):
    n_shards = SHARD_MAP.get(merchant_id, 1)
    suffix = random.randrange(n_shards)
    pk = f"MERCHANT#{merchant_id}#{suffix}"
    ddb.put_item(Item={"PK": pk, "SK": f"TX#{ts_iso}#{tx_id}", **payload})

async def get_recent_50(async_ddb, merchant_id: str):
    n_shards = SHARD_MAP.get(merchant_id, 1)
    tasks = [
        async_ddb.query(
            KeyConditionExpression="PK = :pk",
            ExpressionAttributeValues={":pk": f"MERCHANT#{merchant_id}#{i}"},
            ScanIndexForward=False,
            Limit=50,
        )
        for i in range(n_shards)
    ]
    pages = await asyncio.gather(*tasks)
    merged = merge(*(p["Items"] for p in pages), key=lambda x: x["SK"], reverse=True)
    return list(merged)[:50]
05
STAGE 05 · SYSTEM DESIGN APPLICATIONSL7 · STAFF / PRINCIPAL

Where Write Sharding & Scatter-Gather apply in System Design.

Why this matters: Scope boundary: identify where this pattern fits best and where simpler or async alternatives win.

Write sharding with bounded scatter-gather is the standard remedy for single-key hotspots:

  • Payment Ledgers & Flash-Sale Counters: Distributing celebrity merchant or viral SKU writes across N partitions.
  • IoT & Telemetry Ingestion: Sharding high-volume device/fleet IDs by device_id#bucket.
  • Social Celebrity Timelines: Splitting mega-influencer fanout or engagement counters across K shards.
Practice · Explain the consequences

Practice: Make the trade-off yourself.

Question 1 of 3
Score: 0/3

Why does increasing a DynamoDB table's provisioned WCU from 10,000 to 50,000 NOT stop throttling on a single celebrity merchant at 3,500 writes/sec?

Recommended Learning Flow