Edge computing vs regional cloud: when does running code close to users matter?
"Run it at the edge" means executing code in many locations near users instead of in one or two central cloud regions. It can cut latency, but it isn't automatically better.
What edge platforms are good at
- Redirects, rewrites and header manipulation
- Authentication checks and A/B routing before a request hits your origin
- Personalizing cached pages
- Serving static assets and simple API responses globally
- Light request validation and bot filtering
Where regional cloud still wins
- Workloads that talk to a database many times per request. If your code runs near the user but your database sits in one region, each query crosses the distance anyway, and a chatty request can end up slower.
- Heavy compute, long-running tasks and large memory needs
- Code relying on full language runtimes or native libraries that edge runtimes don't support
The data problem
Latency wins come from having both code and data nearby. Options include read replicas in multiple regions, edge key-value stores, and caching. Each adds consistency questions: how stale can data be?
A sensible default
Keep core application logic and data in a region close to most users. Push caching and simple request-level logic to the edge. Expand further only when you've measured a real latency problem.
Have you moved logic to the edge and seen a meaningful improvement? Or did database round-trips eat the gains?
Comments · 3
I assumed edge was always better. Interesting that data still has to live somewhere, so you can lose the latency benefit if the database is far away.
For most early products, a single region is fine. Edge matters when you have global users and latency-sensitive features.
Which kinds of apps benefit the most from running near the user, like gaming or video?