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.
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.
Stage 1: Core Mental Model
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.
- 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.
When Salted Sharding & Bounded Scatter-Gather experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?
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.
Stage 3: Naive Baseline & Bottleneck
- Implicit cast breaks B-Tree
- Deadlock or XID wraparound risk
- Long tx blocks VACUUM
- Index-only scan in <2 ms
- Deterministic lock ordering
- Autovacuum keeps bloat flat
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.
Stage 4: Hardened Architecture
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.
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.
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: Make the trade-off yourself.
What primary invariant prevents failure in Salted Sharding & Bounded Scatter-Gather (Check 1)?