Skip to main content
The Edge Computing Playbook — What to Run at the Edge (and What Not To)

The Edge Computing Playbook — What to Run at the Edge (and What Not To)

KU
• 4 min read•33 views

The edge is fast because it's constrained. This is the decision map for what belongs at the edge, what belongs at origin, and how compute, data, caching, and auth fit together.

The edge is fast for one reason: your code runs in a data center a few milliseconds from the user instead of one a few hundred milliseconds away. That speed comes with constraints. Small CPU budgets, no long-lived connections, limited runtimes, and data that lives somewhere else. Getting value from the edge is mostly about knowing which work fits inside those constraints and which work should stay at origin.

This is the map. It ties together the moving parts (compute, data, caching, auth, observability) and points to the deep dive for each. Use it to decide where each piece of a request should run.

What the edge is good at

Edge functions shine at short, stateless, per-request work that benefits from being close to the user:

What the edge is bad at

The same constraints that make it fast make some work a poor fit:

  • Heavy compute: edge runtimes cap CPU time per request (often tens of milliseconds). Image processing, large crypto, or big data transforms belong at origin. The exact ceilings are covered in edge runtime limits.
  • Anything needing a full Node runtime: many npm packages assume Node APIs the edge doesn't have.
  • Chatty database access: a function 5ms from the user but 120ms from your database is slower than one that runs next to the database. This is the single most common edge mistake.

The data problem is the whole game

Compute at the edge is easy; data at the edge is the hard part. If your edge function has to reach back to a single-region primary database, you've moved the compute closer to the user but left the slow part where it was. The answer is to move data outward too:

The rule: read-heavy, latency-sensitive data wants to be replicated to the edge; write-heavy or strongly-consistent data wants a single home, with the edge reaching it only when it must.

How requests actually reach the edge

Before any of this runs, the network has to route the user to the nearest point of presence. That's anycast plus smart placement, explained in anycast and geo-routing. It's worth understanding because "the edge" isn't automatically the closest edge. Placement and routing decisions matter, especially for the data tier.

Platform choice

The two dominant platforms make different trade-offs. The head-to-head that started this cluster, Cloudflare Workers vs Vercel Edge, covers latency and cost; the newer Workers vs Lambda@Edge comparison covers the AWS angle. For classic serverless where cold starts dominate, see serverless cold starts and CloudFront + Lambda@Edge.

Don't forget observability

Edge functions run in hundreds of locations, which makes debugging harder, not easier. You need logs, traces, and metrics that aggregate across PoPs, covered in observability for edge functions. Skipping this is how teams end up with a fast site they can't troubleshoot.

The call we'd make

Push the request-shaping work (routing, auth, caching, personalization, streaming) to the edge, and keep heavy compute and authoritative writes at origin. Then solve the data tier deliberately: replicate reads outward, keep strong-consistency writes in one place, and reach for Durable Objects only when you need coordination. Start with one thing, auth or caching, measure the latency win, and expand from there. Each linked guide is a concrete next step; the constraints are the feature, not the bug.

Explore topics:Cloud
React

Get the DevOps Troubleshooting Cheat Sheet

Subscribe and get our free one-page reference for the errors that eat an afternoon — CrashLoopBackOff, OOMKilled, Terraform state locks, and more — plus new guides as we publish them.

Share this post
KU

Kiril Urbonas

AI Engineer

553 articles
View all articles by Kiril Urbonas

You might have missed

Evergreen posts worth revisiting.