Concepts
CDN: DNS-based mapping and edge assembly (ESI)
Intuition
Imagine a chain of neighborhood stores from the same brand, instead of a single giant store downtown. When you ask by phone where to buy, a dispatcher points you to the store closest to you that is open, has no line, and has the product in stock, and that recommendation changes as stores fill up or close. For customized products, the neighborhood store does not need to fetch everything from the factory: it keeps the common parts and only asks the factory for the part that changed, assembling the order right there.
How it works
A CDN (content delivery network) such as Akamai serves requests from surrogate servers of the origin spread across the edge of the Internet (more than 12,000 servers in more than 1,000 networks at the time of the paper). The steering of each client, called mapping, is done by a dynamic, fault-tolerant DNS system: top-level DNS servers delegate to low-level servers in the location closest to the client, which resolve the hostname by choosing a server according to the requested service, the user's location, and the state of the network. The criterion combines proximity (lowest RTT and packet loss), availability (health, CPU, disk and network load, data center bandwidth), and likelihood of having the content, decided by a consistent hashing algorithm. Real-time monitoring feeds this choice: each server reports its load, and if it exceeds one threshold the DNS assigns the content to more servers, and past another threshold the IP is no longer returned; agents that simulate users downloading objects detect and suspend problematic servers or data centers. The final responses have a short TTL (from a few seconds to a minute), which makes it possible to redirect clients when conditions change; the calculations of the ideal server are done offline so as not to delay the DNS. For dynamic content, which ordinary proxy caches cannot cache, Edge Side Includes (ESI) is used: the provider splits the page into fragments with independent cacheability, stored as separate objects in the edge cache and assembled on every request, so that only uncacheable or expired fragments go to the origin. For uncacheable objects, the edge also splits the TCP connection into client-edge and edge-origin.
In practice
The paper reports that, on the dynamic sites studied (portals and financial sites), assembly via ESI reduced origin bandwidth by 95 to 99 percent, and that the approach avoids the cost of idle capacity in clusters, mirrors, and multihoming to absorb flash crowds, as well as the low hit rates (25 to 40 percent) of independent proxy caches. You choose this design when there is a geographically dispersed audience, hard-to-predict traffic spikes, and mixed pages, with static parts and personalized parts, that can be fragmented. The consistency of cacheable fragments is still handled with TTLs, versioned URLs, and on-demand purges, and the idea of moving logic to the edge is the foundation of today's edge computing.
Use it in a design
Practice the cases that rely on this concept in the System Design school.