Projects • Making things • • 4 min read

The Outpost: The Last Room of the Systems-Talking Wing

The room about beating distance. A CDN opens a branch in every town so the answer is already next door, and it closes the systems-talking wing of Learning Maps.

The Outpost · 7:30 · Learning Maps · CC BY 4.0 Watch on YouTube ↗ Learning Maps playlist ↗

A reader in Tokyo asks a library in Virginia for a page. The request crosses an ocean, the answer crosses it back, and no amount of clever engineering makes light travel faster. Latency is distance. So you stop trying to beat it, and instead of making the reader come to the library you open a branch in every town, stock it with copies of the most-asked pages, and let the reader walk next door. That is the last room of the systems-talking wing, the one that stops fighting distance and moves the answer closer.

That branch network is a content delivery network, a CDN, and the little branches are edge locations, caches scattered near where people live. A reader's request stops at the nearest one. A hit is already next door, and a miss makes the long trip back to the original, the origin, exactly once, then stocks the copy so the next neighbor never waits. It is the same hit and miss and stale-copy bet from the cache room, drawn across the whole globe.

What the room teaches

The catch is the one every cache has, which is that a branch can drift from the original. The drift is controlled with a TTL, the time a copy is allowed to live before it is checked again, and CloudFront's default is 24 hours. A new version means waiting the TTL out, paying for an invalidation, or giving the new file a new versioned name, which costs nothing, so no reader is handed yesterday's copy by accident. The limit is that shared, stable, read-heavy things, images and video and static pages, cache beautifully at the edge, while anything unique to one person that has to be correct to the second, a bank balance, a private feed, does not cache there at all. This blog is one of those static sites, served from CloudFront, and how it is built has its own page.

On AWS the CDN is CloudFront. The cousin it gets confused with is Global Accelerator, and the tell is that CloudFront carries copies while Accelerator clears the road. CloudFront works at layer 7, speaks HTTP and caches. Global Accelerator works at layer 4, carries any TCP or UDP traffic, hands out two static IP addresses, and fails over between Regions in under thirty seconds without waiting on any DNS timer, so a game, a voice call, or a workload that needs a fixed IP for an allowlist points at Global Accelerator. The near miss to refuse on the exam is routing each user to the Region that answers fastest, which is Route 53 latency-based routing, a different tool for a different job.

The wing, closed

The Outpost ends a five-room arc about how the parts of a system talk to each other without dragging each other down. The Book Drop and the Greeter were the two front doors, the async queue and the synchronous fleet, the ways a request arrives. The Breaker and the Allowance were the two shields, how a system survives a failing dependency or a stampeding caller. The Outpost is the reach, the move that carries the finished answer all the way out to the reader's door.

Look back and the whole wing rhymes. The queue's freedom to wait, the greeter's route around the dead, the breaker's fast fail, the allowance's steady drip, and now the edge's copy next door are five faces of one idea, stop making the other side wait on you.

If you are just arriving, the map runs in order, the Data Wing on how distributed data behaves, then the coordination pair on how machines agree, then this wing, room by room on Learning Maps. The frame the whole series sits on is AWS is math and Kubernetes is physics.