Things Have History
Five milliseconds from everywhere

software-architecture

Five milliseconds from everywhere

Listen · 4:27

In September 2017, Cloudflare’s global network of 117 edge servers was handling hundreds of billions of requests per month — and running exactly zero lines of customer code. Each of those servers lived close to users: in Frankfurt, in Singapore, in São Paulo. But every request they touched still forwarded to someone else’s origin, possibly thousands of miles away, for actual computation. The edge was a relay. Engineer Kenton Varda wanted to make it a computer.

The project was called Cloudflare Workers. The premise: deploy JavaScript directly to the edge nodes, so that code ran near whoever was making the request rather than in a single leased rack in Virginia. The customer’s origin server would still exist, but a growing fraction of the work — rewriting headers, personalizing responses, enforcing access rules — would never reach it.

The obvious implementation would have been containers. But containers had a problem: cold starts. A Lambda function on AWS, waking a container from scratch, added 500 milliseconds to several seconds to every first request. At the network edge — where the entire value proposition is low latency — that number was disqualifying.

Instead, Varda’s team chose V8 isolates: the sandboxed runtime inside Google Chrome, where it had been tested by billions of users and every researcher’s 40-open-tab session. An isolate is not a container; it is a lightweight execution context within a single OS process, able to run hundreds of siblings simultaneously. Where a basic Node.js Lambda consumed 35 MB of RAM per instance and took 500 milliseconds or more to cold-start, a Workers isolate added roughly 3 MB and launched in approximately 5 milliseconds. The container’s worst quality had simply ceased to exist.

The API design found its shape over lunch in London. Cloudflare engineer Ingvar Stepanyan pointed out that the W3C was finishing a specification called Service Workers — a browser API for intercepting and rewriting network requests in JavaScript. The metaphor was exact. The team adopted the same interface, which meant a developer writing a Cloudflare Worker was writing code nearly identical to what they already knew from the browser.

Workers entered beta on September 29, 2017 and opened to the general public on March 13, 2018, priced at $0.50 per million requests. AWS Lambda billed per millisecond of execution; Workers billed by request count — a model that suited the short, frequent, latency-sensitive tasks that edge logic tends to involve.

What the launch changed was the architecture question. Before 2017, every back-end design started with the same negotiation: which cloud region should the origin server live in? After 2017, the question shifted: how much of the logic can move to the edge, before the request ever reaches the origin? Authentication, geoblocking, A/B routing, header manipulation — none of it requires a round-trip to Virginia if the edge can handle it 50 miles from the user in 5 milliseconds.

The model spread quickly. Edge computing had been discussed in academic literature since at least the early 2000s, but Workers gave it a developer-facing form that CDN operators could ship and application engineers could actually use. Fastly launched Compute@Edge in 2020 using WebAssembly isolates. Deno Deploy, Vercel Edge Functions, and Netlify Edge followed between 2021 and 2022. Every major CDN reached the same architecture within five years.

The origin server is still there. But every year, it handles a little less of the work.

Sources

Spot a mistake?

Wrong date, broken citation, a fact that doesn't hold? Tell us. It lands in an inbox a human reads and the post can be pulled or corrected.