all posts

The best edge function platforms in 2026

Ajay Kumar··9 min read

An edge function is code that runs in a data centre close to the user instead of in one region you picked. The benefit is round-trip latency, and it is real — a hundred milliseconds saved on every request, if the request would otherwise have crossed an ocean. The cost is a constrained runtime: a V8 isolate rather than a full Node process, tight CPU-time limits, restricted APIs, and — most importantly — the same network distance to your database as before.

That last point is where most edge migrations go wrong, so let's start there. I'm Ajay, I build PandaStack, which is deliberately not an edge platform, and I'll say plainly where that means you should pick something else.

The database problem, first

Moving your function to the edge does nothing for a request that then makes three sequential queries to a database in us-east-1. You've saved one network hop to the user and added three from a random location to your data. Plenty of teams have measured a latency regression after an edge migration for exactly this reason.

Edge functions pay off when the work is genuinely local: reading a header and rewriting a URL, checking a token's signature, an A/B assignment, geolocation routing, serving something from a globally replicated store, or streaming a response whose first byte matters more than its total time. If the function's job is mostly 'talk to the database', keep it in the same region as the database.

Before migrating anything to the edge, measure where your latency actually is. If time-to-first-byte is dominated by query time rather than network time, the edge will not help — and may hurt, because you've moved the compute away from the data.

The platforms

Cloudflare Workers

The most mature option and the largest network. The isolate model gives genuinely fast starts, and the surrounding primitives are the real reason to be here: KV for replicated reads, D1 for SQL at the edge, R2 for object storage without egress fees, Durable Objects for coordinated state, and Queues. That ecosystem is what turns 'a function near the user' into an architecture rather than a proxy trick. Constraints: a CPU-time budget per request that punishes computation, a Web-API runtime rather than Node (much better than it used to be, still not the same), and a mental model — Durable Objects especially — that takes real time to learn.

Deno Deploy

The nicest developer experience of the group if you like TypeScript-first, standards-based APIs with no build step. Web APIs work as documented, deploys are near-instant, and a Deno KV store covers simple state. Smaller network and smaller ecosystem than Cloudflare, so weigh it on whether you want the surrounding primitives or just want to run some code globally with minimum ceremony.

Vercel and Netlify edge functions

Best understood as a feature of the framework platform rather than as standalone products. If you're already deploying Next.js or Astro there, edge middleware for auth checks, redirects, and personalisation is right there and integrates cleanly with the rest of the deployment. Don't choose either platform for its edge runtime alone — choose it for the framework integration and treat the edge layer as a benefit that comes with it.

Fastly Compute and AWS Lambda@Edge / CloudFront Functions

Fastly's WebAssembly-based Compute has excellent cold-start characteristics and appeals if you're already a Fastly CDN customer. The AWS pair is what you use when you're deep in AWS and want edge behaviour attached to CloudFront: CloudFront Functions for tiny header manipulations, Lambda@Edge for anything more, with deployment propagation that is measured in minutes rather than seconds.

The case for not going to the edge

A large fraction of code deployed as edge functions doesn't need to be there. It's there because the platform made it the default, and it now carries constraints — no long-running work, no arbitrary npm packages with native bindings, no full filesystem, a CPU budget — that the workload didn't need to accept.

The alternative shape is a regional function or a small always-available service that runs your normal language runtime with no API restrictions, placed in the same region as your data. You lose the global proximity, which for an authenticated app talking to one primary database you were never really getting anyway.

That's the category my own product is in, and I'd rather be clear about it than fudge the comparison: PandaStack runs serverless functions and scheduled jobs inside Firecracker microVMs, in a region, not at the edge. What you get for giving up proximity is an unrestricted runtime — real Python or Node with any dependency including native ones, no CPU-time ceiling, a real filesystem, and hardware-level isolation between tenants because each invocation is a VM rather than a shared isolate. What you give up is the hundred milliseconds, and per-invocation overhead measured in hundreds of milliseconds rather than single-digit ones. For a webhook handler, a nightly report, or a job that shells out to ffmpeg, that's a good trade. For URL rewriting on every page view, it's a bad one.

# A regional function with an unrestricted runtime — any dependency,
# no CPU-time ceiling, isolated per invocation.
pandastack function deploy ./handler.py \
  --name invoice-webhook \
  --runtime python

# Same thing on a cron schedule, no always-on server involved:
pandastack schedule create \
  --name nightly-rollup \
  --function-id <id> \
  --cron "0 3 * * *"

How to choose

  1. Is the work genuinely local to the request — headers, tokens, routing, geolocation, a replicated read? If yes, edge, and probably Cloudflare Workers for the ecosystem.
  2. Are you already on Vercel or Netlify with a framework that has edge middleware? Use what's in front of you; the integration is worth more than a marginally better runtime.
  3. Do you want standards-based TypeScript with no build step and no vendor primitives? Deno Deploy.
  4. Does the function talk to a regional database more than it talks to the user? Keep it regional. The edge is not the bottleneck you think it is.
  5. Does it need arbitrary packages, native binaries, real CPU time, or a filesystem? You need a container or a microVM, not an edge runtime — and you should stop calling it an edge function.

Short version

Cloudflare Workers is the default and the surrounding primitives are the real product. Deno Deploy is the nicest to write. Vercel and Netlify edge functions are features of platforms you'd choose for other reasons. And a meaningful share of workloads labelled 'edge' should be regional functions with an unrestricted runtime — closer to the database, free of the CPU budget, and boring in the way that infrastructure should be.

Frequently asked questions

What is the difference between edge functions and serverless functions?

Location and runtime, which turn out to be the same decision. A serverless function runs in a region you choose, typically in a container or microVM with a full language runtime — real Node or Python, arbitrary dependencies including native ones, a filesystem, and generous execution time. An edge function runs in many locations near users, usually inside a lightweight V8 isolate, which is why it starts in single-digit milliseconds and why it restricts you to Web APIs, a strict CPU-time budget, and no native modules. Edge wins on proximity to the user; regional serverless wins on proximity to your data and on what the code is allowed to do.

Do edge functions actually make my app faster?

Only if network distance to the user is what is slow. For static personalisation, header manipulation, auth-token checks, redirects, and geolocation routing, moving the work to the edge removes a genuine round trip and the improvement is immediately visible. For a function whose main job is querying a database in one region, the picture reverses: you have saved one hop to the user and added several from an arbitrary edge location to your data, and teams regularly measure a net regression. Profile first. If time-to-first-byte is dominated by query time rather than network time, the edge is not your problem.

Can I use npm packages in edge functions?

Some of them. Modern edge runtimes have improved Node-compatibility substantially, so pure-JavaScript packages that stick to standard APIs generally work. What does not work is anything with native bindings — image processing libraries, database drivers compiled against C clients, cryptography implementations backed by native code — because there is no place in an isolate to load a compiled binary. Bundle size limits also bite: edge platforms cap the deployed bundle far below what a Node function permits, so a dependency tree that pulls in a large library may simply not fit. Check both constraints against your actual dependency list before committing to a migration.

Are edge functions cheaper than regional serverless functions?

Usually per invocation, because an isolate is far cheaper to start than a container, and the platforms price accordingly with generous free tiers. But the comparison is not like-for-like. Edge pricing typically charges for requests and CPU milliseconds, so compute-heavy work gets expensive quickly or exceeds the CPU budget entirely. Regional serverless charges for wall-clock duration and memory, which is more forgiving of work that waits on I/O. And if the edge function makes several cross-region database calls it may bill more total time than the regional equivalent would have. Price your actual workload rather than comparing headline rates.

When should I not use edge functions?

When the function's real work is talking to a regional database, when it needs more than a few dozen milliseconds of CPU, when it depends on packages with native bindings, when it needs a filesystem or to spawn a process, or when you need strong isolation between tenants rather than shared-isolate isolation. Those cases want a regional function on a container or microVM runtime, placed next to the data. This is not a small category: a lot of code that ended up on an edge runtime is there because a framework defaulted it there, and it inherited constraints that its workload never needed.

Keep reading

Run code in a microVM in one API call.

49ms p50 cold start. Fork, snapshot, and scale to zero.

Start free
Written by Ajay Kumar, Founder, PandaStack.