Skip to main content
← CONCEPTS / DISTRIBUTED-SYSTEMS
An end-to-end domain learning journey

Salted Sharding &
Bounded Scatter-Gather.

Eliminate hot-partition skew by suffixing heavy-hitter keys with a bounded salt and merging reads via parallel scatter-gather.
Start the journey7 sections· Last modified Nov 22, 2026
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

If replicas diverge under asymmetric network delays, adaptive K-way salting spreads 80k QPS hot-key writes evenly across all K shards.

TL;DR30-second simplified summary
▾

Deterministic hash(key) % N routing collapses when Zipfian skew concentrates traffic on a single celebrity key. Adaptive salted sharding appends a bounded salt #0..#(K-1) only to detected hot keys, spreading write load uniformly across K shards while executing bounded O(K) parallel scatter-gather on reads.

Before you begin · Building blocksAlready know these? Jump to Stage 01 ↓
Consistent Hashing & Virtual Nodes
Consistent hashing assigns data keys to servers in a way that limits how many keys move when servers are added or removed. This helps avoid widespread cache misses and sudden load on databases.
Full walkthrough · 7 stages
01
foundation

Stage 1: Core Mental Model.

Why this matters: Establish core mental model invariants for Salted Sharding & Bounded Scatter-Gather.

Think of Stage 1: Core Mental Model as the intuition layer for Salted Sharding & Bounded Scatter-Gather: Establish core mental model invariants for Salted Sharding & Bounded Scatter-Gather.

Stage 1: Core Mental Model establishes how Salted Sharding & Bounded Scatter-Gather behaves under real production load.

Request & State Flow

Stage 1: Core Mental Model

Client TxPlanner / Lock MgrWAL / MemTableHeap / SSTable1. Acquire snapshot / index plan2. Append redo record + fsync WAL3. Flush dirty pages / compactSSTables4. Commit & release row locks
02
foundation

Stage 2: Production Failure Mode.

Why this matters: Establish production failure mode invariants for Salted Sharding & Bounded Scatter-Gather.

Think of Stage 2: Production Failure Mode as the intuition layer for Salted Sharding & Bounded Scatter-Gather: Establish production failure mode invariants for Salted Sharding & Bounded Scatter-Gather.

Stage 2: Production Failure Mode establishes how Salted Sharding & Bounded Scatter-Gather behaves under real production load.

Engineering Decision Framework
Problem
How to implement Salted Sharding & Bounded Scatter-Gather 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
If replicas diverge under asymmetric network delays, adaptive K-way salting spreads 80k QPS hot-key writes evenly across all K shards.
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 Salted Sharding & Bounded Scatter-Gather experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?

03
intermediate

Stage 3: Naive Baseline & Bottleneck.

Why this matters: Establish naive baseline & bottleneck invariants for Salted Sharding & Bounded Scatter-Gather.

Think of Stage 3: Naive Baseline & Bottleneck as the intuition layer for Salted Sharding & Bounded Scatter-Gather: Establish naive baseline & bottleneck invariants for Salted Sharding & Bounded Scatter-Gather.

Stage 3: Naive Baseline & Bottleneck establishes how Salted Sharding & Bounded Scatter-Gather behaves under real production load.

Design Trade-Off

Stage 3: Naive Baseline & Bottleneck

Before · Seq Scan + Unbounded Bloat
  • Implicit cast breaks B-Tree
  • Deadlock or XID wraparound risk
  • Long tx blocks VACUUM
After · Indexed Plan + Bounded MVCC
  • Index-only scan in <2 ms
  • Deterministic lock ordering
  • Autovacuum keeps bloat flat
04
intermediate

Stage 4: Hardened Architecture.

Why this matters: Establish hardened architecture invariants for Salted Sharding & Bounded Scatter-Gather.

Think of Stage 4: Hardened Architecture as the intuition layer for Salted Sharding & Bounded Scatter-Gather: Establish hardened architecture invariants for Salted Sharding & Bounded Scatter-Gather.

Stage 4: Hardened Architecture establishes how Salted Sharding & Bounded Scatter-Gather behaves under real production load.

Component Topology

Stage 4: Hardened Architecture

Client TxingressQuery PlannercomputeWAL BufferstorageStorage PagescontrolSQL queryappend redocheckpoint flush
05
intermediate

Stage 5: Reference Implementation & Rollback.

Why this matters: Establish reference implementation & rollback invariants for Salted Sharding & Bounded Scatter-Gather.

Think of Stage 5: Reference Implementation & Rollback as the intuition layer for Salted Sharding & Bounded Scatter-Gather: Establish reference implementation & rollback invariants for Salted Sharding & Bounded Scatter-Gather.

Stage 5: Reference Implementation & Rollback establishes how Salted Sharding & Bounded Scatter-Gather behaves under real production load.

06
advanced

Stage 6: Complexity & Capacity Bounds.

Why this matters: Establish complexity & capacity bounds invariants for Salted Sharding & Bounded Scatter-Gather.

Think of Stage 6: Complexity & Capacity Bounds as the intuition layer for Salted Sharding & Bounded Scatter-Gather: Establish complexity & capacity bounds invariants for Salted Sharding & Bounded Scatter-Gather.

Stage 6: Complexity & Capacity Bounds establishes how Salted Sharding & Bounded Scatter-Gather behaves under real production load.

07
advanced

Stage 7: Operational Runbook & Telemetry.

Why this matters: Establish operational runbook & telemetry invariants for Salted Sharding & Bounded Scatter-Gather.

Think of Stage 7: Operational Runbook & Telemetry as the intuition layer for Salted Sharding & Bounded Scatter-Gather: Establish operational runbook & telemetry invariants for Salted Sharding & Bounded Scatter-Gather.

Stage 7: Operational Runbook & Telemetry establishes how Salted Sharding & Bounded Scatter-Gather behaves under real production load.

Practice · Explain the consequences

Practice: Make the trade-off yourself.

Question 1 of 3
Score: 0/3

What primary invariant prevents failure in Salted Sharding & Bounded Scatter-Gather (Check 1)?

Recommended Learning Flow