Edge Computing & Cloudflare Workers 2026: The Complete Problem-Solving Guide
By Huzi
File #554 · 4 min read
Physics first, because edge computing is physics before it is anything else: light covers roughly 200 kilometres of fibre in a millisecond, so a round trip to another continent can never be optimised into feeling instant. The only real fix is moving the code to the user, and Cloudflare Workers does that across a network of more than 300 locations.
The quick answer: Cloudflare Workers runs your code as V8 isolates across 300-plus locations, so it starts in single-digit milliseconds near the user. Use it for small, stateless requests with edge storage — Workers KV, D1, R2, Durable Objects — and keep heavy compute, chatty database joins and Node-shaped code on ordinary servers.
Isolates, not containers
A conventional serverless function boots a small machine for your code; that boot is the cold start, and it arrives at the worst moments. A Worker is a V8 isolate — the same sandboxed JavaScript context a browser gives a tab — and starting one costs single-digit milliseconds because there is nothing to boot.
The price of that speed is discipline: a modest memory ceiling and a strict CPU budget per request, milliseconds on the free plan and far more on paid. Those limits are the design, not a defect. Edge code is small, stateless and fast because it is allowed to be nothing else.
The storage map
| Storage | What it is | What it solves |
|---|---|---|
| Workers KV | Key-value reads in about a millisecond, anywhere | Config, flags, cached responses — never the source of truth |
| D1 | SQLite replicated globally | Users, orders, content — ordinary relational data |
| R2 | S3-compatible objects with no egress fees | Uploads, media, generated files |
| Durable Objects | One strongly consistent instance per key, with WebSockets | Chat, presence, rate limiters — the stateful things |
The consistency caveat bites: Workers KV is eventually consistent, so a write in one region can take a while to appear in another. Respect that line and the map stays boring, which is the compliment.
When edge is the wrong answer
The honest section. Four cases:
- Heavy compute. Transcoding, report generation, model training — a Worker orchestrates, it does not crunch. Put that work in a container on an ordinary host.
- Chatty database work. If your endpoint joins a dozen tables, the code belongs next to the database, not next to the user.
- In-memory sessions. Any of hundreds of locations can serve a request, so process-memory sessions break by design. Use signed tokens or Durable Objects.
- Node-shaped code. There is no filesystem and no full Node runtime by default — write Web-standard code:
fetch,crypto.subtle, streams.
For everything else, wrangler tail streams production logs live, and request.cf.country hands you the visitor's country with no lookup service. A geo-router in five lines:
export default {
async fetch(request) {
const country = request.cf?.country ?? "PK";
return Response.redirect("https://api.example.com/" + country, 307);
},
};
Pro tip: Run
wrangler tailin one terminal while you load your site in the other — real production logs and the actualrequest.cf.countryvalues will teach you more than any benchmark before you write the routing logic.
The platforms, briefly
Cloudflare has the widest footprint and the cheapest entry — a few dollars a month unlocks tens of millions of requests. Vercel's edge is the smoothest if you live inside Next.js. Deno Deploy is the nicest place to write TypeScript.
Lambda@Edge makes sense when AWS already owns the rest of your stack, with cold starts and per-invocation bills accepted as the price of staying in the family.
The wrong-tool list doubles as travel advice: a family of five does not belong in a hatchback to Hunza, and a visa file does not belong in an inbox nobody answers. Matching the vehicle to the journey is most of the desk work at HTG Travels.
Gaza lives the opposite of that promise — neighbourhoods going dark when the connections are cut — which keeps me honest about what speed is worth where access itself is denied.
Everything at our desk is the other kind of latency: the deliberate kind. A visa file takes the days it takes, and a drive up the Karakoram Highway should be rushed by nothing. We book the slow journeys at HTG Travels — Hunza, Skardu and Swat runs out of Sialkot and Lahore — nothing on them measured in milliseconds.
Write to +92 317 5054959 on WhatsApp for a mountain window instead of the second monitor.




