Skip to content
Velloreth
Technology 10 min read

Edge Computing: Where It Helps and Where It Doesn't

Edge computing moves code closer to users. It wins for latency-sensitive request paths and loses for heavy compute, state, and anything needing a region.

By

Edge computing is the idea of running your code in dozens or hundreds of small locations spread around the world, instead of one or a few large cloud regions. The pitch is latency: a request from Nairobi handled in a Nairobi data center is faster than the same request round-tripping to Virginia. The reality is more specific. Edge computing wins on a particular class of workloads — thin, request-scoped, latency-sensitive logic — and loses on everything that looks like a traditional backend.

This post is about knowing which side of that line your workload falls on.

What edge actually is

A traditional serverless function (AWS Lambda, Google Cloud Functions, Azure Functions) runs in a region you choose. A user in Manila talking to a function in ap-southeast-1 still pays the network round trip to Singapore — typically tens of milliseconds, sometimes more.

An edge function runs across a provider’s entire network. Cloudflare Workers run in over 300 cities; Fastly Compute and Cloudflare’s peers operate at similar scale. The same code is deployed everywhere, and the request is handled at whichever location the user’s traffic naturally reaches — usually via anycast routing, where one IP address is announced from many locations and BGP sends the user to the nearest one.

That is the whole architectural shift: compute location becomes a network property instead of a provisioning choice.

Where it helps

1. Request routing and rewriting

The highest-value edge use case is the boring one: deciding what happens to a request before it reaches your origin.

  • Redirecting /blog/* to a new URL structure.
  • Geolocating a user and routing them to the right language version.
  • Injecting headers, rewriting paths, or terminating auth before the origin sees the request.
  • A/B testing by setting a cookie and rewriting HTML at the edge.

Doing this at the origin means every user pays the round trip to your region before being sent somewhere else. Doing it at the edge means the redirect happens in the same city as the user. For a global audience, that is the difference between a 200ms redirect and a 15ms one.

2. Authentication and rate limiting

An auth check that runs at the edge never touches your database if the token is invalid. JWT verification, API key validation, and coarse rate limiting are all cheap, stateless, and benefit enormously from being close to the user. Invalid requests are rejected in single-digit milliseconds without waking up your origin at all.

This is also where edge platforms integrate well with zero-trust style access: Cloudflare Access, for instance, enforces identity at the same network layer that serves the content.

3. API fronts and aggregation

A thin edge layer that sits in front of several backend services — fetching, combining, and trimming responses — is a natural fit. The classic example is a mobile app backend: the edge function assembles a home-feed response from three internal APIs, caches the public parts, and returns a trimmed payload. The heavy work stays regional; the assembly happens near the user.

4. Personalization of cached content

CDNs already cache aggressively. Edge compute lets you make cached content dynamic without going to the origin: serve the same HTML shell to everyone, but inject a personalized header, recommendation strip, or feature flag at the edge. You keep the cache-hit ratio of static content with the relevance of dynamic content.

5. Bots, WAF logic, and security filtering

Custom bot detection, challenge pages, and request filtering are request-scoped and latency-sensitive. Running them at the edge means bad traffic never reaches your application. Writing this logic as edge code is also more flexible than a WAF rule language.

6. Image and payload transformation

Resizing images, converting formats (WebP, AVIF), compressing responses, and trimming payloads are compute-light operations that sit directly on the content-delivery path. Doing them at the edge removes a hop and lets you cache the transformed result close to users.

Where it does not help

1. Heavy compute

Edge machines are deliberately small. Cloudflare Workers historically ran with 128MB of memory and strict CPU-time limits per request (the limits have increased over time, but the design principle remains: many small machines, not a few large ones). If your workload is video encoding, large-scale data processing, machine learning inference on a big model, or anything that wants multiple cores and gigabytes of RAM, a regional instance is the right tool.

2. Anything that must talk to one region anyway

This is the trap that catches most first migrations. Your users are global, but your database is in us-east-1. An edge function in Tokyo still has to round-trip to Virginia for every query — so you have added a network hop (user → edge → database) instead of removing one (user → database). Unless you cache aggressively at the edge, replicate the database, or restructure the data so the hot path is edge-local, edge compute adds latency rather than subtracting it.

Edge computing pays off when the critical path can complete without a long trip to a single region. If it cannot, fix the data layer first.

3. State and long-running work

Edge functions are request-scoped by design. They start, handle one request (or a short stream), and stop. There is no durable process holding state in memory between requests. You can use external state (Redis, Durable Objects, KV stores), but the mental model is stateless handlers plus external state — not a server that keeps a session in a local variable.

Long-running jobs (report generation, video processing, batch exports) belong on a regional worker, a queue consumer, or a container platform.

4. Node.js-native and native-code dependencies

Edge runtimes are typically not full Node.js. Cloudflare Workers use the V8 isolates model with a Web-standard API surface (fetch, caches, streams); Deno Deploy is similar; older Lambda@Edge used a constrained Node subset. Packages that rely on native addons, the full Node filesystem API, or specific OS libraries will not run without a rewrite. Always check the runtime’s compatibility before planning a migration.

5. Strong consistency requirements

If two requests that arrive at different edge locations must observe exactly the same state in the same order, you are fighting the architecture. Edge platforms offer eventually-consistent KV stores and strongly-consistent coordination primitives (Cloudflare Durable Objects being the canonical example), but the default posture is distributed and eventually consistent. Workloads that need global strong consistency — financial ledgers, some inventory systems — usually belong in a single region with well-understood replication.

Cold starts: the tax that mostly went away

The classic objection to serverless in general, and edge in particular, was cold starts: the pause while a platform spins up a fresh instance of your code. Spreading code across hundreds of locations made this worse, not better — there are more places for a cold start to happen.

The industry’s response has been decisive. Cloudflare Workers launched with cold starts under 5 milliseconds and has since moved toward eliminating them entirely for many workloads, using lightweight V8 isolates instead of containers. That is roughly a thousand times faster than container-based platforms where cold starts can reach seconds. The result: for request-path logic, cold-start anxiety is no longer a serious argument against edge compute. It remains an argument against naive container-based serverless on critical paths.

A decision table

QuestionIf yesIf no
Is the work done per-request, in milliseconds?Strong edge candidateKeep it regional
Does the hot path avoid a single-region database?Edge pays offFix data locality first
Does it need >1GB memory or multi-core CPU?Regional instanceEdge is fine
Is it long-running or stateful in-process?Queue / worker / containerEdge is fine
Does it use native Node addons?Rewrite or stay regionalEdge runtime likely works

The platforms, briefly

You do not need a vendor matrix, but it helps to know the shapes:

PlatformRuntime modelNotable trait
Cloudflare WorkersV8 isolates, Web-standard APIsBroadest network (300+ cities); Durable Objects for state; R2/KV/D1 integration
Fastly ComputeWebAssemblyStrong in media and compute-heavy edge; per-request pricing
Vercel Edge FunctionsV8 isolates (Edge Runtime)Tight Next.js integration; smaller footprint than full edge networks
Netlify Edge FunctionsDeno-basedDeno/TypeScript native; good for Jamstack sites
Deno DeployDeno/Web APIsStandards-forward; multi-region by default

The practical differences for most teams are network footprint, runtime compatibility with the libraries you already use, and pricing shape. If your existing stack is Next.js on Vercel, edge functions are a low-friction experiment. If you are designing a new global API from scratch, Cloudflare’s network and state primitives (Durable Objects, KV, D1) are worth a serious look.

State at the edge: Durable Objects and friends

Earlier we said edge functions are stateless. That is true of the request handler, but the platforms have grown purpose-built state primitives. Cloudflare Durable Objects are single-threaded, strongly consistent coordination points: one object instance per key, with in-memory state, transactional storage, and optional WebSocket hibernation. A rate limiter, a collaborative editing session, a game room — things that need “exactly one authoritative copy” — map naturally onto a Durable Object, even though the rest of your request handling is globally distributed.

This changes the architecture conversation. The old reflex was “stateful work must go regional.” The new one is “stateful work needs a single point of coordination — that point can live at the edge, close to where it is needed, as long as the platform gives you strong consistency for it.”

How to start without a rewrite

You do not need to move your application to the edge to benefit. The staged path most teams take:

  1. Put a CDN in front. Static assets and cacheable responses first. This alone removes most of the latency for content-heavy sites.
  2. Add edge middleware for auth, redirects, and headers. Platforms like Cloudflare Workers, Vercel Edge Functions, and Netlify Edge Functions let you write a small script that runs before your origin.
  3. Move personalization and A/B logic to the edge. Cache the heavy parts; vary the light parts.
  4. Revisit the data layer only if the math demands it. Read replicas in more regions, edge-replicated KV for hot keys, or a redesign so certain paths are edge-complete.

Each stage is independently valuable. Many teams stop at stage 2 or 3 and never need to touch their database topology.

The honest summary

Edge computing is not the future of all backend computing. It is the correct answer for the thin layer that touches every user — routing, auth, filtering, assembly, and personalization — especially when your audience is geographically spread out. It is the wrong answer for heavy compute, strong state, and anything that round-trips to one region anyway.

One framing that keeps the decision honest: measure the round trip. If a request spends 200ms crossing an ocean to your origin and 5ms being processed there, moving the processing to the edge saves 195ms and is obviously worth it. If the request spends 5ms crossing and 200ms in a database query, the edge saves nothing you will feel. Most edge decisions reduce to which number dominates your user’s experience — and the only way to know is to instrument it, not to reason about it from a conference talk.

The technology has matured past the hype. Cold starts are measured in milliseconds, the runtimes cover most Web-standard work, and the pricing suits spiky, request-shaped workloads. Use it where the request path is thin and the user is far from your origin. Leave the rest where it is.

Frequently asked questions

Is edge computing just a rebranded CDN?
A CDN caches and serves content; edge platforms execute your code at those same locations. The distribution is similar — Cloudflare Workers run across the same 300-plus-city network as its CDN — but the capability is different: you write arbitrary request handlers, not cache rules.
When should I not use edge computing?
Avoid it when the workload needs large memory or CPU, must talk to a single-region database on the critical path, requires long-running processes, or depends on Node.js-native APIs that the edge runtime does not implement. In those cases the latency win disappears or the code simply will not run.
Do cold starts make edge functions slow?
They used to be the main objection. Cloudflare Workers reports cold starts under 5 milliseconds, and the platform has since moved toward zero-millisecond cold starts for many workloads. Older container-based platforms (AWS Lambda and similar) can still show hundreds of milliseconds to seconds on cold start, which matters for latency-sensitive paths.
What is the real cost advantage of edge?
For request-handling workloads, edge platforms often price per request at rates that undercut a constantly-running regional server. The savings appear when your baseline traffic is low or spiky. For sustained heavy compute, a reserved regional instance is usually cheaper per unit of work.