The Edge Computing Playbook — What to Run at the Edge (and What Not To)
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:
- Routing and rewrites: A/B tests, feature flags, geo-based redirects, request normalization. This is the sweet spot for Vercel edge middleware.
- Auth checks: validating a signed token before a request ever reaches origin, covered in edge auth without origin round-trips.
- Caching and cache logic: deciding what to serve from cache, with patterns like stale-while-revalidate and disciplined cache invalidation.
- Personalization at the CDN: small transforms on cached HTML per user or region.
- Streaming responses: starting to send HTML while the rest is still assembling, via streaming SSR at the edge.
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:
- Edge databases replicate reads to the PoPs. See edge databases for low-latency apps and the Turso vs Cloudflare D1 comparison.
- Edge object storage like Cloudflare R2 vs S3 keeps assets close and egress cheap.
- Stateful coordination: when you need a single authoritative place to serialize writes (counters, rooms, locks), Durable Objects give you one addressable instance instead of a race across PoPs.
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.
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.
Fixing DNS Resolution Failures in Kubernetes
A pod can't reach a service by name, the app throws connection errors, and everyone blames the network. Usually it's DNS, and usually it's fixable.
Kubernetes Error Troubleshooting Guide (2026): Every Common Pod Error
CrashLoopBackOff, ImagePullBackOff, OOMKilled, Pending, NodeNotReady, CreateContainerConfigError, and failing probes, each with what it means, the command that diagnoses it, and the usual fix.
More from Cloud
Explore more articles in this category
Azure OpenAI's Sweden Central Outage: A Health Check Postmortem
A slow database made a backend service look dead, and the health check that was supposed to protect it killed it faster. The lesson has nothing to do with AI.
GKE Pod Snapshots: Cold Starts Drop 89%, If Your Nodes Match
Google's benchmarks show a 70B model restoring in 37 seconds instead of minutes. The catch is a hash and a hardware match that silently refuses to restore when either is off.
AWS Lost a Region for Good: Multi-AZ Is Not Disaster Recovery
AWS says it cannot restore data held only in Bahrain (me-south-1) or in one UAE zone. Multi-AZ gave availability, not recovery, and only cross-region copies survived.
You might have missed
Evergreen posts worth revisiting.