FFORGE//RS
← Roadmap

distributed systems / LEVEL 3

Midnight cache stampede

EST.35 MIN
01

THEORY / RETRIEVAL

What to restore

  • Recognize why cache-aside alone does not prevent duplicate loads
  • Separate correctness, freshness and load-control guarantees

A miss is a coordination event

When many requests miss the same hot key, every request may call the origin. TTL jitter spreads expirations across keys, while single-flight coordinates concurrent work for one key. They solve related but different failure modes.

Do not hold a global lock across slow work

A global mutex around the origin call prevents a stampede but serializes unrelated keys. Production designs coordinate per key, bound waiters, propagate cancellation and decide whether stale data is acceptable.

CHECKPOINT

Which change most directly prevents 500 concurrent misses for one key from issuing 500 identical origin requests?

ISOLATED RUST 1.96
src/main.rsEDIT

02 / IMPLEMENTATION

Implement the contract

Complete the counter update using the entry API. The small exercise isolates the atomic in-memory step used inside a larger cache coordinator.

Initializing editor…
CLOUD SANDBOXnetwork off · 256 MB · 12 s
1 / 64 KB
OUTPUT
Runner is waiting for a submission.