Race weekscene 20 / 26~2 min
Caches, the CDN, and state
Which boxes are allowed to multiply.
The Saturday tour ends where Sunday’s success will actually be decided: at the question of which boxes are allowed to multiply.
Two cache layers complete a story Act I started. The application cacheConcept · lights on your mapapplication cacheThe backend-side store holding copies of expensive answers in memory, so the database is not asked the same question a thousand times a second. Fast, and honest about its price: speed, paid in freshness. is the backend’s own copy shelf: the leaderboard, computed once, served ten thousand times, refreshed on the rhythm the mat taught you at 190 milliseconds. And the CDNConcept · lights on your mapCDNContent delivery network: a provider’s fleet of cache servers in hundreds of cities, holding static content close to users. Tokyo gets the course map from Tokyo. Nearly every site you use sits behind one. is the same idea at planetary scale, a rented fleet of cache servers in hundreds of cities holding the course map and the logo and everything static, so a spectator in Tokyo fetches from Tokyo. Molly’s browser cache, the application cache, the CDN: one bargain, three distances, and now the family portrait is complete.
The insight the whole weekend rests on
Here is the pair. A component that keeps no memory between requests is statelessConcept · lights on your mapstatelessA component keeping no memory between requests: everything it needs arrives with the request or lives elsewhere. Any instance can serve anyone, which is what makes it freely addable and killable.. A component that holds the memory itself is statefulConcept · lights on your mapstatefulA component that holds the memory: a database, a queue, a cache. It cannot be casually duplicated or discarded, since it contains the thing the system is meant to remember.: the database, the queue, the caches. And the insight is this: stateless things multiply for free. Any tracking instance can serve any spectator, since the instance remembers nothing, so Sunday simply runs thirty of them. The stateful core cannot be photocopied so casually, since it IS the memory, and every copy is a promise about truth that Thursday taught you the price of.
So the architecture’s deep shape, visible now across the whole wall: a small, fiercely protected stateful core, the database and its twin, the queue, and a wide, cheap, disposable stateless rim that scales like weather. Sunday’s plan, in one sentence: let the rim multiply, and let nothing touch the core that does not have to.
The tour is over. The freeze has held. Sam sets an alarm for 4:15 and does not need it. Sunday begins in the dark.
End of scene
This scene covers: application cache, CDN, stateful, stateless