Question
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.
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.