Content Delivery Network System Design Template
DNS, anycast and steering, edge and shield hierarchy, pull and proactive fill, tag purge, TLS at edge, ISP appliances, cache keys, observability
Cara menggunakan: Use it when you design or evaluate a CDN, build versus buy delivery, or answer that interview question. Fill peak egress, request rate, object sizes and catalog size first, then the cache key rules for each tenant. The main pitfall is a cache key mistake that either caches private responses publicly or splits hits across useless variants.
Pratinjau
System Design: [Content delivery network name]
Reference design for a content delivery network (CDN) that serves web assets, images, API responses and video segments for several internal tenants: request routing with DNS and anycast, a cache hierarchy of edge, shield and origin, pull-through and proactive fill, purge and invalidation, TLS at the edge, origin shielding, appliances embedded in ISP networks, cache key design and observability. It applies HTTP caching as specified in RFC 9111, with RFC 9213 (targeted cache control), RFC 9211 (Cache-Status) and RFC 5861 (stale content). It follows the structure of the System Design Document template, adds a 45-minute interview path, and is pre-filled with a worked design to adapt. Replace every
[bracketed]value and every row marked Example; numbers marked Example are assumptions to recompute.
Document control
| Field | Value |
|---|---|
| Document ID | [SDD-CDN-001] |
| System / feature | [Content delivery network] |
| Version | [0.1] |
| Status | [Draft / In review / Approved / Implemented / Superseded] |
| Owner | [@owner] |
| Author(s) | [@author] |
| Approvers / reviewers | [@reviewer-1], [@reviewer-2] |
| Last updated | YYYY-MM-DD |
| Classification | [Internal / Confidential] |
| Tenants | [Web, images, API, video] |
| Footprint | [Number of PoPs, embedded ISP sites, regions] |
| Related | Video Streaming System Design (system-design/design-video-streaming), Live Streaming System Design (system-design/design-live-streaming), Photo Sharing System Design (system-design/design-photo-sharing) |
Approvals
| Role | Name | Decision | Date |
|---|---|---|---|
| Tech lead | [@name] | [Approved / Changes requested] | YYYY-MM-DD |
| Staff / principal engineer | [@name] | [Decision] | YYYY-MM-DD |
| Network engineering | [@name] | [Decision] | YYYY-MM-DD |
| Security (TLS keys) | [@name] | [Decision] | YYYY-MM-DD |
| Finance (transit and peering) | [@name] | [Decision] | YYYY-MM-DD |
Revision history
| Version | Date | Author | Change summary |
|---|---|---|---|
| 0.1 | YYYY-MM-DD | [@name] | First draft for design review |
| 0.2 | YYYY-MM-DD | [@name] | Example: Regional shield tier added after origin load analysis |
| 0.3 | YYYY-MM-DD | [@name] | Example: Tag-based soft purge replaces URL-list purge |
| 1.0 | YYYY-MM-DD | [@name] | Example: Approved |
Contents
1. Overview
1.1 Problem statement
[Example: The company buys delivery from two commercial CDNs. Egress is the second largest infrastructure cost, purges take up to 15 minutes, cache hit ratio for images is 82% because each provider fills from origin separately, and video quality in three large markets suffers from congested transit links that neither provider controls.]
1.2 Proposed solution
[Example: Build an owned CDN for the largest tenants and keep a commercial CDN as overflow. About 200 points of presence (PoPs) announce shared anycast addresses for web and API traffic; video clients receive server-specific URLs from a steering service. Each PoP runs edge caches with consistent hashing inside the PoP; misses go to one regional shield per origin, which collapses duplicate fetches before they reach the origin. Popular video is filled proactively to edge and to appliances embedded in partner ISPs during off-peak hours. Purges use tags and soft invalidation and reach all PoPs within 5 seconds at p99. TLS terminates at the edge with ECDSA certificates, and every response carries a Cache-Status header for debugging.]
1.3 Decisions requested from reviewers
| ID | Question | Recommended option | Section |
|---|---|---|---|
| Q-01 | Example: How do clients reach the nearest edge? | Anycast for web and API; steering service URLs for video | 7.1 |
| Q-02 | Example: Cache hierarchy? | Edge, then one regional shield per origin, then origin | 7.2 |
| Q-03 | Example: Purge model? | Tag-based soft purge, 5 s p99 global target | 7.4 |
| Q-04 | Example: Deploy appliances inside ISPs? | Yes for the top markets by video traffic | 7.3 |
| [Q-nn] | [Question] | [Option] | [Section] |
1.4 45-minute interview path
| Minutes | Cover | Output on the whiteboard |
|---|---|---|
| 0 to 5 | Core requirements (2.1) and below the line (2.3) | Serve cached content close to users; purge; TLS |
| 5 to 10 | Estimates (3) with consequences | Egress Tbit/s, servers per PoP, origin load with and without shield |
| 10 to 15 | API (4) and data model (5) | Config, purge API, cache index entry |
| 15 to 25 | High-level design (6) | Client, routing, edge, shield, origin, control plane |
| 25 to 40 | One or two deep dives | 7.1 (routing) by default; 7.4 (purge) if consistency comes up; 7.5 (cache keys) if security comes up |
| 40 to 45 | Failure modes and 10x (9.1, 10.1) | What breaks first and the fix |
Separate the data plane (serving bytes) from the control plane (configuration, purge, steering) in the first diagram.
2. Requirements
2.1 Core functional requirements
| ID | Requirement | Priority |
|---|---|---|
| FR-01 | Example: Serve HTTP/1.1, HTTP/2 and HTTP/3 over TLS from the PoP nearest the client | Must |
| FR-02 | Example: Cache according to origin headers, with per-tenant override rules | Must |
| FR-03 | Example: Purge by URL, by prefix and by tag | Must |
| FR-04 | Example: Collapse concurrent misses for the same object into one origin fetch | Must |
| FR-05 | Example: Serve stale content when the origin fails, within tenant-set limits | Must |
| FR-06 | Example: Proactive fill of objects listed by a tenant before a launch | Should |
| FR-07 | Example: Per-tenant TLS certificates, automated issuance and renewal | Must |
| FR-08 | Example: Near-real-time logs and metrics per tenant | Must |
| [FR-nn] | [Requirement] | [Must / Should / Could] |
2.2 Non-functional requirements
| ID | Quality | Target | Measured as |
|---|---|---|---|
| NFR-01 | Byte hit ratio | Example: 95% at edge for images and video, 99% including shield | Edge and shield logs |
| NFR-02 | Time to first byte, cache hit | Example: p75 under 50 ms from client | Real user monitoring |
| NFR-03 | Purge propagation | Example: 99% of PoPs within 5 s, all within 30 s | Purge confirmation receipts |
| NFR-04 | Availability | Example: 99.99% of requests served without 5xx caused by the CDN | Edge logs |
| NFR-05 | Origin protection | Example: Origin request rate under 1% of edge request rate | Origin logs |
| NFR-06 | Configuration rollout | Example: Config change live everywhere within 2 min, staged | Config version telemetry |
| [NFR-nn] | [Quality] | [Target] | [Measurement] |
2.3 Below the line (out of scope)
- [Example: volumetric DDoS scrubbing at layers 3 and 4 beyond PoP capacity (contracted provider)]
- [Example: web application firewall rule authoring (separate product team)]
- [Example: edge compute for arbitrary tenant code]
- [Example: video packaging and DRM (see Video Streaming System Design (
system-design/design-video-streaming))] - [Example: selling the CDN to external customers]
- [Item deferred, with the release that will take it]
3. Capacity estimation
3.1 Assumptions
| Input | Value | Source |
|---|---|---|
| Peak egress, all tenants | Example: 100 Tbit/s | Current CDN invoices x growth |
| Peak requests per second | Example: 50 million | CDN logs |
| Average object size served | Example: 250 KB (mix of 20 KB web assets and 2 MB video segments) | CDN logs |
| Points of presence | Example: 200 | Network plan |
| Cacheable catalog, unique bytes | Example: 5 PB | Tenant inventories |
| Serving capacity per edge server | Example: 100 Gbit/s, run at 50% | Benchmark |
| Storage per edge server | Example: 100 TB (flash and disk) | Hardware spec |
Check: 50 million requests/s x 250 KB = 12.5 TB/s = 100 Tbit/s, which matches the egress assumption.
3.2 Servers and storage
- Average per PoP: 100 Tbit/s / 200 = 500 Gbit/s; at 50 Gbit/s usable per server that is 10 servers, 2 000 in total, with large metros holding many times the average. Consequence: PoP sizes follow traffic, not a fixed template; capacity planning is per metro.
- Storage per average PoP: 10 x 100 TB = 1 PB, 20% of the catalog. Consequence: the edge cannot hold everything; hit ratio depends on popularity skew, so eviction policy and proactive fill for predictable content (7.3) matter.
3.3 Origin load
- With a 95% edge byte hit ratio, misses are 5 Tbit/s.
- Without a shield, each of 200 PoPs fetches a missing object independently: up to 200 origin fetches per new object and 5 Tbit/s at origins.
- With a regional shield at 80% hit ratio: 5 Tbit/s x 0.2 = 1 Tbit/s at origins, and each new object is fetched once per shield. Consequence: shielding is mandatory for every origin; tenants size origins for 1% of edge traffic, not 5%.
- Origin requests: 50 million x 0.05 x 0.2 = 500 000 requests/s across all tenants.
3.4 Purge
- Example: 1 000 purge requests/s at peak across tenants. Sending each to 2 000 servers directly would be 2 million messages/s. Consequence: purges fan out per PoP (200 messages each) and are broadcast inside the PoP; tags let one request cover thousands of objects.
3.5 TLS
- At Example: 10 requests per connection, 50 million requests/s means 5 million new connections/s. With 80% session resumption, 1 million full handshakes/s. At Example: 20 000 ECDSA P-256 signatures per core per second, that is 50 cores globally; with RSA-2048 at Example: 1 500 per core it would be about 670 cores. Consequence: serve ECDSA certificates by default, keep RSA only for old clients, and keep resumption tickets valid across servers in a PoP.
3.6 Summary
| Quantity | Estimate | Design consequence |
|---|---|---|
| Egress | 100 Tbit/s | ~2 000 edge servers in 200 PoPs; sized per metro |
| Edge storage | ~1 PB per average PoP | Popularity-aware eviction; proactive fill |
| Origin load | 1 Tbit/s with shield, 5 Tbit/s without | One shield per origin, request collapsing |
| Purge | 1 000/s | PoP-level fan-out, tags, soft purge |
| TLS | 1 million full handshakes/s | ECDSA default, shared resumption keys |
4. API design
4.1 Control plane endpoints
| Method and path | Purpose | Notes |
|---|---|---|
PUT /v1/properties/{id} | Create or update a tenant property (hostnames, origins, cache rules) | Versioned; staged rollout |
POST /v1/properties/{id}/activate | Roll out a config version | Canary PoPs first |
POST /v1/purge | Purge by URLs, prefix or tags; hard or soft | Returns a purge id |
GET /v1/purge/{purge_id} | Propagation status | Percentage of PoPs confirmed |
POST /v1/prefetch | Proactive fill of listed URLs to selected tiers | Rate-limited per tenant |
PUT /v1/certificates/{hostname} | Upload or request a certificate | Automated renewal |
GET /v1/logs/stream | Stream request logs | Sampled for high-volume tenants |
4.2 Data plane headers
The origin controls caching through standard headers; the edge reports what it did.
HTTP/1.1 200 OK
Cache-Control: public, max-age=60, stale-while-revalidate=30, stale-if-error=86400
CDN-Cache-Control: max-age=86400
Surrogate-Key: product-123 category-shoes
Vary: Accept-Encoding
Cache-Status: ExampleCDN-shield; fwd=miss; stored, ExampleCDN-edge; hit; ttl=84211
Cache-Control governs browsers; CDN-Cache-Control (RFC 9213) gives the
CDN a longer lifetime that browsers ignore. stale-while-revalidate and
stale-if-error (RFC 5861) allow serving stale content during refresh and
origin errors. Surrogate-Key is a widely used, vendor-defined tag header,
not an RFC; the edge strips it before the response leaves the CDN.
Cache-Status (RFC 9211) lists each cache tier's result, ordered from the
cache closest to the origin to the cache closest to the client, so each tier
appends its own entry.
4.3 Errors and limits
| Case | Behaviour |
|---|---|
| Purge request above tenant limit | 429 with Retry-After; tags recommended over URL lists |
| Invalid config | Rejected at validation with problem details naming the rule |
| Origin unreachable, no stale copy | 502 or 504 to client with Cache-Status showing the failing tier |
| Request for an unknown hostname | 421 Misdirected Request; no default tenant |
5. Data model
5.1 Entities
The control plane is small and strongly consistent; cache indexes are local to each server.
5.2 Storage choices
| Data | Store | Key | Why |
|---|---|---|---|
| Tenants, properties, versions | Example: Replicated relational database in the control plane | property_id, version | Audited, transactional, small |
| Compiled config | Pushed bundle on every edge server | Hostname | No control-plane call on the request path |
| Cache index | In-memory hash table per server | Hash of the cache key | One lookup per request |
| Cached bytes | Local flash and disk per server | Location from the index | Throughput and capacity |
| Tag index | Per-server map from tag to keys | Tag | Tag purge without scanning |
| Purge log | Replicated log in the control plane, mirrored per PoP | Sequence number | PoPs that were offline replay missed purges |
5.3 Access patterns
| Query | Served by | Key or index | Partition rationale |
|---|---|---|---|
| Which server in a PoP owns this object | Consistent hash ring per PoP | Cache key hash | One copy per PoP, more for hot objects |
| Is this object cached and fresh | Cache index on the owning server | Cache key hash | Memory lookup |
| Which config applies to this host | Compiled config | Host header or TLS SNI | Loaded locally |
| Which objects carry tag T | Tag index | Tag | Purge fan-out inside the server |
| Which purges has this PoP missed | Purge log | Last applied sequence number | Ordered replay |
| Which edge should serve this client | Routing (anycast) or steering service | Client network prefix | Network topology, not data |
6. High-level design
| Component | Responsibility | Scales by |
|---|---|---|
| PoP load balancer | Terminate anycast address, spread connections | Servers per PoP |
| Edge server | TLS, cache lookup, serve, fetch from shield on miss | Servers per PoP |
| ISP-embedded appliance | Serve popular video inside an ISP network | Partner sites |
| Regional shield | Collapse misses from many PoPs per origin | Shields per origin region |
| Distributor | Push config versions and purges to all servers | Fan-out tree per region |
| Steering service | Choose a server for video sessions from health and inventory | Request rate of session starts |
| Telemetry pipeline | Logs, metrics, inventory reports | Event volume |
7. Detailed design
7.1 Deep dive 1: request routing
Problem. Clients must reach a nearby, healthy server with spare capacity, and must be moved away quickly when a PoP fails.
| Option | How it works | Strengths | Weaknesses |
|---|---|---|---|
| A. DNS-based | Authoritative DNS answers with a PoP address chosen from the resolver's location (or the client subnet when the resolver sends it, RFC 7871) | Fine-grained control, per-PoP load decisions | Resolver may be far from the client; DNS caching slows failover to the TTL |
| B. Anycast | All PoPs announce the same addresses; BGP delivers to the nearest by routing | Fast failover by withdrawing routes; absorbs floods | Routing decides, not load; a route change can move live connections |
| C. Application steering | The application or player asks a steering service, which returns server-specific URLs | Uses inventory and health per server; ideal for long video sessions | Needs client integration |
Choice. B for web, image and API hostnames; C for video sessions, with A as the backup path when anycast catchments become uneven.
Reason. Short web requests benefit from anycast's simplicity and fast failover. Video sessions are long and large, so choosing a server that already holds the file, and is close in network terms, pays off. Steering uses routes learned from ISPs and server inventory, not just geography.
7.2 Deep dive 2: cache hierarchy and fill
Problem. Each tier that misses independently multiplies origin load, while each extra tier adds latency on misses.
| Option | Origin fetches per new object | Miss latency |
|---|---|---|
| A. Flat: every edge fetches from origin | Up to one per PoP | Lowest |
| B. Edge, then regional shield per origin | One per shield | One extra hop |
| C. Edge, then any-PoP peer, then shield | One per shield; fewer shield hits | Peer lookup cost |
Choice. B, with request collapsing at both tiers: while a fetch for an object is in flight, later requests wait for it instead of starting new fetches. Inside a PoP, consistent hashing places each object on one owner server so the PoP stores one copy; objects above Example: 1 000 requests/s on one server are replicated to several servers in the PoP.
Reason. The shield turns 5 Tbit/s of misses into 1 Tbit/s at origins (3.3) and caps fetches per new object, which protects origins during launches. Large objects are fetched and cached in byte ranges (Example: 2 MB chunks) so a seek in a large file does not pull the whole file through the shield.
Fill modes:
| Mode | When | Note |
|---|---|---|
| Pull-through | Default for all content | Fills on first request |
| Prefetch API | Tenant knows a launch list | Rate-limited, to shield or to edge |
| Proactive scheduled fill | Predictable video popularity | Off-peak windows; to edges and ISP appliances (7.3) |
7.3 Deep dive 3: ISP-embedded appliances and proactive fill
Problem. In some markets the bottleneck is the link between the ISP and the CDN, not the CDN itself; peak-hour video crosses congested transit.
| Option | Effect | Cost |
|---|---|---|
| A. More PoP capacity at exchange points | Better peering | Still crosses the ISP's edge at peak |
| B. Appliances inside the ISP network | Peak video stays inside the ISP | Hardware logistics, partner agreements |
| C. Buy more transit | Quick | Highest ongoing cost; congestion beyond our control |
Choice. A everywhere and B for the top markets by video traffic. Appliances receive popular video during off-peak fill windows, computed from predicted demand, and can fill from nearby appliances. The ISP decides which of its customers are routed to the appliances, and the steering service sends video sessions there.
Reason. For predictable catalogs, moving bytes at night and serving them locally at peak removes the congested link from the critical path, which benefits both the ISP and the viewers.
How real systems do it (paraphrased from Netflix, "Open Connect Overview", openconnect.netflix.com; inspiration only). Netflix describes Open Connect as its own CDN, started in 2011, built from purpose-built cache appliances placed in two ways: at internet exchange points, where they connect to ISPs through settlement-free peering, and inside ISP networks, where Netflix supplies the hardware and the ISP supplies power, space and connectivity and controls which customers are routed to them. The appliances store only video and image files, no member data, and do two jobs: report health, learned BGP routes and stored files to a control plane in the cloud, and serve files over HTTP or HTTPS. When a member presses play, cloud services check authorisation, pick the needed files, and a steering service chooses appliances and returns their URLs to the device. Most content is placed proactively during off-peak fill windows based on predicted viewing, and appliances can fill from each other. Check the overview for the current details.
7.4 Deep dive 4: purge and invalidation
Problem. Tenants need changes visible quickly, but deleting objects everywhere at once can send a thundering herd to the origin.
| Option | Speed | Origin impact | Use |
|---|---|---|---|
| A. Short TTLs only | Bounded by TTL | Constant revalidation | Small sites |
| B. Versioned URLs (content hash in the path) | Instant for new references | None | Static assets, images |
| C. Hard purge by URL or tag | Seconds | Burst of misses | Legal takedowns, private data exposure |
| D. Soft purge by tag (mark stale, revalidate) | Seconds | Conditional requests, stale served meanwhile | Content updates |
Choice. B as the default advice for static assets; D for content updates; C reserved for legal and security cases.
Reason. Soft purge keeps the stale copy available, so the first request
revalidates with a conditional request (often a 304) while others are
served stale within the tenant's stale-while-revalidate window. Purges
travel through the distributor as an ordered log; each PoP confirms the
sequence number it applied, which gives the 5 s p99 measurement and lets a
PoP that was offline replay what it missed before it rejoins anycast.
7.5 Cache key design
The cache key decides correctness and hit ratio. The default key is scheme, normalised host, path and a sorted allow-list of query parameters.
| Rule (Example) | Effect | Risk if wrong |
|---|---|---|
Drop tracking parameters (utm_*, fbclid) | Raises hit ratio | None if the origin ignores them |
Include Accept-Encoding only as a normalised class (br, gzip, identity) | Few variants | Hundreds of variants from raw header values |
Never cache responses to requests with Authorization unless the origin marks them public | Prevents leaks | Private data served to other users |
| Do not cache responses that set cookies | Prevents session leaks | Session fixation across users |
Device class only when the origin sends Vary on a declared header | Correct variants | Cache poisoning through unkeyed headers |
| Headers that change the response must be in the key or rejected | Blocks poisoning | Attacker stores a harmful variant |
8. Scalability and performance
| Concern | Approach | Limit before redesign |
|---|---|---|
| Egress growth | Add servers per PoP, then new PoPs and ISP sites | Peering capacity per metro |
| Hot objects | Replicate inside the PoP above a request threshold | NIC capacity of the replicas |
| Origin load | Shield and collapsing | Shield capacity per origin region |
| Config size | Compiled per hostname, delta pushes | Example: 100 000 hostnames per bundle |
| Purge rate | Tags and per-PoP fan-out | Tag index memory per server |
Latency budget for a cache hit (target p75 50 ms time to first byte):
| Step | Budget |
|---|---|
| Network round trip to nearest PoP | 20 ms |
| TLS 1.3 handshake (one round trip; zero with resumption and early data where allowed) | 20 ms |
| Load balancer and cache lookup | 2 ms |
| First bytes from memory or flash | 3 ms |
| Headroom | 5 ms |
9. Reliability, security and operations
9.1 Failure modes
| Component | Failure | Detection | Blast radius | Mitigation | RTO |
|---|---|---|---|---|---|
| Edge server | Crash or disk failure | Load balancer health checks | Objects owned by it in one PoP | Ring removes it; misses refill from shield | Example: 10 s |
| PoP | Power or network loss | Synthetic probes, BGP session loss | Clients in that catchment | Withdraw anycast routes; steering avoids it | Example: 1 min |
| Shield | Overload or failure | Shield error rate | Misses for its origins | Secondary shield per origin; serve stale | Example: 2 min |
| Tenant origin | Outage | Origin error rate | That tenant's misses | stale-if-error; shielding protects recovery | Tenant dependent |
| Bad config push | Wrong rules everywhere | Canary PoP error rates | All tenants on that version | Staged rollout, automatic rollback on canary regression | Example: 5 min |
| Purge pipeline | Stalled | Confirmation lag | Stale content served | Alert; PoP out of anycast if it cannot replay | Example: 15 min |
| Route leak or hijack | Traffic misrouted | BGP monitoring, RPKI validation | Region or global | RPKI-signed origins, more specific announcements in emergencies | Minutes |
9.2 Security
| Threat | Control |
|---|---|
| Private key theft from an edge server | Keys in memory only, sealed at rest; optionally remote signing for high-value hostnames |
| Cache poisoning | Cache key rules (7.5); unkeyed headers stripped or rejected |
| Cached private data | Default no-store for authenticated requests; tenant tests in CI |
| Origin exposure | Origins accept traffic only from shields (mutual TLS or signed headers) |
| Request floods | Anycast absorption, per-tenant rate limits; see Resilience and Load Shedding Design (system-design/resilience-load-shedding-design) |
| Tenant config tampering | Signed config bundles, audited control plane access |
| [Threat] | [Control] |
9.3 Observability
| Signal | Metric | Alert threshold |
|---|---|---|
| Hit ratio | Byte and request hit ratio per tenant and tier | Drop of 5 points vs 7-day baseline |
| TTFB | Real user monitoring p75 per country | Above 80 ms for 15 min |
| Origin load | Requests per origin vs edge requests | Above 1% for 15 min |
| Purge latency | Time to 99% confirmation | Above 5 s |
| Errors | 5xx by cause (Cache-Status tier) | CDN-caused 5xx above 0.01% |
| Fill | Proactive fill completion before window end | Below 98% |
9.4 Cost estimate
| Item | Unit cost | Quantity | Monthly cost |
|---|---|---|---|
| Edge servers | [USD per server-month] | Example: 2 000 | [USD] |
| PoP colocation and power | [USD per rack-month] | [Racks] | [USD] |
| Transit and paid peering | [USD per Gbit/s-month] | [Committed Gbit/s] | [USD] |
| ISP appliances | [USD per appliance, amortised] | [Count] | [USD] |
| Overflow commercial CDN | [USD per GB] | [GB] | [USD] |
| Total | [USD] |
10. Trade-offs and alternatives
10.1 Decisions
| Decision | Options | Chosen | Why | What we give up |
|---|---|---|---|---|
| Build or buy | Commercial only; owned only; owned plus overflow | Owned plus overflow | Cost and control for large tenants, safety for spikes | A network team to staff |
| Routing | DNS; anycast; steering | Anycast for web, steering for video | Fast failover, inventory-aware video | Two routing systems |
| Hierarchy | Flat; shield; peer | Edge plus shield | 5x less origin load | Extra hop on misses |
| Purge | TTL; hard; soft by tag | Soft by tag, hard for legal | No origin herd | Stale content during revalidation window |
| Fill | Pull only; proactive | Both | Off-peak fill for predictable video | Prediction errors waste fill bandwidth |
| At 10x (1 Pbit/s) | ISP appliances become the main tier for video; more shields per origin; custom server software for throughput | Hardware and partner programme at scale | ||
| At 0.1x (10 Tbit/s) | Buy from one or two commercial CDNs; keep cache key and purge practices | Owning a network is not worth it | ||
| [Decision] | [Options] | [Chosen] | [Why] | [Cost] |
10.2 Alternatives considered
- Commercial multi-CDN only. Lowest effort; at this scale egress pricing and lack of ISP placement were the deciding costs. Kept as overflow and as the 0.1x answer.
- Peer-to-peer delivery between viewers. Reduces egress for live events but adds client complexity and privacy concerns; not pursued.
11. Delivery plan and risks
11.1 Milestones
| Milestone | Scope | Exit criterion | Target date |
|---|---|---|---|
| M1 | 20 PoPs, anycast, images tenant at 5% | Hit ratio and TTFB at least equal to commercial CDN | YYYY-MM-DD |
| M2 | Shields, tag purge, all static tenants | Purge p99 under 5 s | YYYY-MM-DD |
| M3 | Steering service and video tenant | Rebuffering not worse than control | YYYY-MM-DD |
| M4 | ISP appliances in top 3 markets | Peak transit reduced by target share | YYYY-MM-DD |
11.2 Rollout and rollback
[Example: Traffic is shifted per tenant and per country by weighted DNS between the owned CDN and commercial providers. Rollback moves the weight back within one DNS TTL (Example: 60 s).]
11.3 Risks
| ID | Risk | Likelihood | Impact | Mitigation | Owner |
|---|---|---|---|---|---|
| R-01 | Example: Cache key mistake leaks private responses | Low | High | Default no-store for authenticated requests; key review per tenant | [@name] |
| R-02 | Example: ISP partnership delays | High | Medium | Exchange-point capacity first; appliances as upside | [@name] |
| R-03 | Example: Anycast catchments overload one PoP | Medium | Medium | Traffic engineering with BGP communities; DNS fallback | [@name] |
| [R-nn] | [Risk] | [L / M / H] | [L / M / H] | [Mitigation] | [@name] |
12. Appendices
12.1 Open questions
| ID | Question | Owner | Due |
|---|---|---|---|
| OQ-01 | Example: Remote signing for all tenants or only high-value hostnames? | [@name] | YYYY-MM-DD |
| OQ-02 | Example: Which video titles qualify for proactive fill? | [@name] | YYYY-MM-DD |
| [OQ-nn] | [Question] | [@name] | YYYY-MM-DD |
12.2 Glossary
| Term | Meaning |
|---|---|
| PoP | Point of presence: a site with edge servers and network connectivity |
| Shield | A cache tier between edges and an origin that collapses misses |
| Anycast | One IP address announced from many sites; routing picks the nearest |
| Byte hit ratio | Share of bytes served from cache rather than fetched upstream |
| Soft purge | Marking cached objects stale so they are revalidated, not deleted |
| Surrogate key | A tag attached to responses so many objects can be purged together |
| Request collapsing | Sending one upstream fetch for many concurrent identical misses |
| [Term] | [Meaning] |
12.3 References
Inspiration only for company write-ups; RFCs define the protocol behaviour.
| Reference | Use |
|---|---|
| RFC 9111 HTTP Caching (June 2022) | Freshness, validation, storing rules |
| RFC 9213 Targeted HTTP Cache Control (June 2022) | CDN-Cache-Control |
| RFC 9211 The Cache-Status HTTP Response Header Field (June 2022) | Per-tier cache result reporting |
| RFC 5861 HTTP Cache-Control Extensions for Stale Content (May 2010) | stale-while-revalidate, stale-if-error |
| RFC 7871 Client Subnet in DNS Queries (May 2016) | DNS-based routing input |
| RFC 9846 The Transport Layer Security (TLS) Protocol Version 1.3 (2026, obsoletes RFC 8446) | TLS at the edge |
| RFC 9114 HTTP/3 (2022) | HTTP/3 at the edge |
| Netflix, "Open Connect Overview" (openconnect.netflix.com) | Embedded appliances, steering, off-peak fill (paraphrased in 7.3) |
Back-of-Envelope Estimation (system-design/back-of-envelope-estimation) | Method for section 3 |
Standard and licence note
Based on the IETF HTTP caching specifications RFC 9111, RFC 9213, RFC 9211 and RFC 5861 and the other RFCs listed in 12.3, and on common industry practice for content delivery networks. The Netflix overview is cited as inspiration only. This is a reference design to adapt, with illustrative numbers. Original text written for this collection; check the current official versions of the cited specifications. Template licence: MIT.
Templat terkait
Agent Orchestration Platform System Design Template
Agent run platform design: durable step journal, resume, MCP tool broker with Tasks, A2A calls, human approvals, tenant budgets, evaluation hooks
Desain SistemAgent Code Execution Sandbox System Design Template
Code execution sandbox for agents: microVM vs gVisor vs containers, egress proxy, credential broker, quotas, snapshot restore, warm pools, abuse detection
Desain SistemAI Coding Assistant System Design Template
AI coding assistant design: IDE and CLI clients, repo indexing, context assembly, agent loop, microVM sandbox, MCP and Agent Skills, approvals, security