Design a CDN
HardSystem design · Edge Infrastructure · Netflix
Design a content delivery network. Customers point their domains at it, and end users fetch static and media content from nearby edge locations, with misses filled from the customer's origin.
In scope: request routing to a healthy nearby edge, cache layout and keys, request collapsing and a shield tier, large-object handling, purge propagation, and observability. Out of scope: building the physical network and edge compute languages.
Requirements
- Route users to nearby healthy edge locations using anycast or DNS steering, with fast health feedback
- Cache with TTLs, well-designed cache keys, and tag-based or versioned invalidation
- Protect origins from spikes with request collapsing, a shield tier and stale-while-revalidate
- Handle large media objects via sliced caching and range requests