Edge computing (Workers)
Running code in data centers close to the user, on the CDN, instead of in one central region.
Edge computing runs code in data centers close to the user, usually on a CDN’s network, instead of in one central region. Requests are answered from a nearby location, which cuts network delay for work that does not depend on a distant database.
Platforms such as Cloudflare Workers run small functions in many locations, start in milliseconds and scale to zero. That suits routing, auth checks, redirects, APIs and rendering. The catch is data: code at the edge is fast only if the data it needs is also nearby or cached; a function in Warsaw querying a database in Virginia is still slow. Edge functions are a form of serverless, usually with tighter limits on run time, memory and available APIs than a regular server.
For state, edge platforms offer stores built for them, such as Durable Objects, which keep one authoritative copy of a piece of state. The edge is also a good place for rate limiting and a WAF, because bad traffic stops before it reaches your servers. If pages rarely change, a static site served from a CDN gets most of the speed without running code per request.
Sources
- Cloudflare: Cloudflare Workers developers.cloudflare.com
Related terms
- Durable Objects: Cloudflare’s single-instance objects with their own storage: one place in the world that owns a piece of state.
- Static site: A website served as ready-made files (HTML, CSS, images) with no server code or database running per visit.
- Rate limiting: Capping how many requests a user, key or IP can make in a time window, and answering HTTP 429 above it.
- Serverless: Running code as functions the cloud starts on demand and bills per request, with no servers for you to manage, scaling down to zero when idle.
- WAF (web application firewall): A filter in front of a web app that blocks malicious HTTP requests before they reach your code.
- Authoritative server (netcode): In multiplayer games, the server decides the true game state; clients only send inputs and predict what will happen.
