Highlights

Contents

Part VI
06

Geographic routing

We select a serving site through network and service policy rather than assuming the closest dot on a map always wins. Routing and cache placement affect each other during normal traffic and failures. We will compare DNS selection and anycast, trace redirects, and keep regional origin ownership explicit.

CHAPTER ATLAS / FOLLOW THE READING PATHCHAPTER ATLAS / FOLLOW THE READING PATH1Edges, origins, hits andmisses2TTL and Cache-Control3Invalidation andversioned URLs4Pull vs push CDN andshielding5Signed URLs and privatedelivery6Geographic routing7Video and image delivery8Case study: private videodelivery

#Section 21DNS-based site selection

A viewer asks for Heron’s delivery hostname. The provider can answer DNS according to policy informed by network, geography, health, and capacity. Geographic routing chooses a serving destination using location-related information together with the actual policy constraints.

The resolver’s location may differ from the viewer’s, and answers can be cached. A changed DNS answer does not move an established connection immediately. The selected site may be near in a map but slower through the actual network, so latency and reachability evidence should influence design rather than geographic distance alone.

DNS SELECTS AN ADDRESS USING THE INFORMATION AVAILABLE TO THE RESOLVERDNS SELECTS AN ADDRESS USING THE INFORMATION AVAILABLE TO THE RESOLVERviewerresolverselected edgeDNS decisionresolver vantage + health + policysubsequent connectionviewer connects to the returned addressa cached DNS answer can outlive a routing change
Figure 14.25Illustrative DNS routing atlas. The resolver and viewer have different locations; policy selects an address before the viewer connects. Geography alone does not establish the fastest usable route.

A service can also redirect at HTTP after more information becomes available, at the cost of another exchange and an updated URL or host. These mechanisms are product-dependent and can coexist. Explain which decision selects the edge, which selects origin, and when each can change.

#Section 22Anycast follows routing decisions

With anycast, the same service address can be announced from multiple network locations and routing directs traffic toward one reachable announcement. Network path policy influences the chosen site. It does not guarantee the smallest geographic distance or fastest application response.

RFC 4786 discusses operational anycast behavior and stateful-service considerations. A route change can affect where later packets go, so connection and service designs must handle their actual continuity model. A CDN’s transport termination and routing controls need product-specific verification.

THE SAME ADVERTISED ADDRESS CAN LEAD TO DIFFERENT SERVING SITESTHE SAME ADVERTISED ADDRESS CAN LEAD TO DIFFERENT SERVING SITESsite Asite Bsite CA, B and C advertise one service addressnetwork routing policy selects the reachable siteconnection state still belongs to the site that accepted it
Figure 14.26Illustrative anycast atlas. Different sites advertise one service address and network routing policy selects the reachable destination. Connection state still belongs to the accepting site.

Do not confuse anycast destination selection with the application load balancer behind the selected site. The edge may still distribute connections among local servers and fetch from a separate regional origin. Those are additional decisions using different available information and failure boundaries.

#Section 23Route health and cold failover

A delivery site fails, so new viewers are sent elsewhere. The replacement site’s cache may be cold for that audience’s keys. Geographic failover therefore changes origin demand and first-read latency even when the replacement has enough edge bandwidth.

The illustrative equal-size model with 95% hits sent 50 requests per second to origin. If all 1,000 viewer requests miss after a cold transition, original source demand becomes 1,000, a factor of 20 of the warm miss rate. Request collapsing, shielding, and bounded stale service may reduce it under their declared rules.

TRAFFIC SHIFTS TO A COLD EDGE: ORIGIN GOES FROM 50/S TO 1,000/S, 20×TRAFFIC SHIFTS TO A COLD EDGE: ORIGIN GOES FROM 50/S TO 1,000/S, 20×warm (down)coldwarm 95% hits: 50/s · cold: all 1,000/s miss until it fillscollapse, a shield and admission bounds protect the origin
Figure 14.27Illustrative cold-route stress case. It excludes reuse acquired during the transition and extra retries.

Health information can be stale or incomplete. Test partial failure, high latency, unreachable origins, and capacity saturation rather than only a fully dead site. The reliability unit’s warning about removing capacity applies here too: an over-sensitive health rule can shift load into another overloaded region.

#Section 24Residency, latency, and state ownership

Heron may allow global playback of published immutable clips while score writes remain under one authoritative region or per-match owner. Edge delivery reduces some retrieval distance without moving write authority. Cached score reads need the declared freshness rule because a nearby answer can still be old.

Under an illustrative latency mixture, 90% hits at 20 milliseconds and 10% misses at 200 produce a weighted mean of 38 milliseconds. Multiply 0.9 by 20 to get 18 and 0.1 by 200 to get 20, then add. This mean does not establish a tail percentile or the worst viewer’s experience.

90% HITS AT 20 MS + 10% MISSES AT 200 MS = 38 MS MEAN, AND SAYS NOTHING ABOUT P9990% HITS AT 20 MS + 10% MISSES AT 200 MS = 38 MS MEAN, AND SAYS NOTHING ABOUT P99each square = 1%0.9 × 20 = 180.1 × 200 = 20mean 38 msthe tail sits in the misses; you need the distribution to state it
Figure 14.28Illustrative two-class latency model. Geography, setup, and origin queues can change both classes.

Compare geographic coverage, connection setup, delivery bandwidth, origin capacity, and consistency policy separately. The fastest nearby edge cannot serve absent or unauthorized content. A convincing interview design tells the reader which layer handles each of those constraints.