Multi-tier cache coherence protocol

DesignHard45 minShopify and Amazon style

Your task

Design a multi-tier cache-coherence protocol for a product-catalog service that fronts Postgres with three layers: an in-process L1 (per-app-instance, ~5k entries), a shared L2 (Redis cluster), and a CDN edge L3 (~200 PoPs). You run 400 app instances. A price update must be reflected globally within 2 seconds, reads are 50k QPS, writes are 200/s, and stale prices are a compliance problem. Walk through how invalidation propagates across all three tiers, how you avoid a thundering herd on the origin when a hot key is invalidated everywhere at once, and how you bound the inconsistency window.

It covers

  • Multi tier
  • Coherence
  • Write through