What Is Edge Computing?
Edge computing runs code in data centers geographically close to the end user — reducing latency by processing requests at the 'edge' of the network rather than in a central server.
Edge computing runs your application code in many data centers placed physically close to users, so requests are handled at the nearest network node instead of one central server. The result is lower latency, because the response no longer has to travel across the planet before any code executes.
What edge computing actually is
A traditional app runs in one region — say, a server in Virginia. A user in Tokyo opening that app sends each request roughly halfway around the world and waits for it to come back, which adds 150–300ms of round-trip latency before your code even starts running. That delay is dictated by the speed of light over fiber, so no amount of faster server hardware fixes it.
Edge computing removes the distance problem by deploying the same code to 100+ locations (often called points of presence, or PoPs) at once. Each request is routed to whichever node is closest to the user, so the network hop is short for everyone, everywhere.
How edge runtimes work
Platforms like Vercel Edge Functions, Cloudflare Workers, and Deno Deploy push your code to a global network. When a request arrives, it lands on the nearest PoP and runs there.
The key detail: edge code runs inside a lightweight V8 isolate, not a full Node.js process. An isolate is a sandboxed JavaScript context that boots in roughly a millisecond, so there's effectively no cold start. The trade-off is that it's not a Node.js environment — it exposes web-standard APIs (fetch, Request, Response, crypto) but restricts or omits Node-specific ones.
Edge vs. serverless functions
Both run on-demand without a server you manage, but they make opposite trade-offs:
| Serverless (regional) | Edge | |
|---|---|---|
| Runtime | Full Node.js | V8 isolate (web APIs only) |
| Cold start | ~100–500ms | <5ms |
| Location | One region | Global PoPs |
| Node APIs | Full | Restricted |
| Best for | Heavy work, DB-bound logic | Fast, light, global responses |
The short rule: serverless gives you a full runtime in one place; edge gives you a stripped-down runtime everywhere.
When to use the edge — and when not to
Good fits:
- Middleware that runs before a page renders — auth checks, redirects, A/B-test bucketing, feature flags
- Geolocation-based personalization (language, currency, content) decided at the nearest node
- API responses that need to be fast worldwide
- Bot detection or header rewriting without a round-trip to a central region
Poor fits:
- Anything that needs a persistent database connection — opening a Postgres connection from every PoP is expensive and exhausts connection limits fast
- Long-running or compute-heavy tasks (large file processing, native modules, image transcoding)
- Code depending on Node-only APIs: filesystem access,
child_process, or libraries that assume a full Node runtime
A practical pattern is to keep latency-sensitive routing logic at the edge and let it call back to a regional serverless function or a managed API for the heavy, data-bound work.
Common mistakes
- Putting your whole app at the edge. The edge is for thin, fast logic. Moving database-heavy endpoints there usually makes them slower, because the data still lives in one region and the edge node now has to reach back to it.
- Connecting directly to a traditional database. Raw Postgres/MySQL drivers fail or perform badly in isolates. Use an HTTP-based data layer — for example, a REST/HTTP API or a serverless-friendly connection pooler — so the edge function talks over
fetchinstead of holding a socket. - Assuming Node APIs exist. Code that imports
fsor a native module will work locally and break once deployed to the edge.
Concrete example
For a booking SaaS like BookBed (Flutter, Firebase, Stripe), edge middleware can read the visitor's region from the request and redirect to the correct localized landing page in a millisecond at the closest PoP — no detour to a central server. The actual reservation write still goes through Firebase, where the data lives. That split — light routing at the edge, real work in the region — is the typical production shape.
Key takeaways
- What it is: running code in many locations near users to cut network latency.
- How: lightweight V8 isolates on a global network, near-zero cold start.
- Use it for: middleware, redirects, geolocation, fast lightweight global responses.
- Avoid it for: direct database connections, heavy compute, Node-only APIs.
- Cost: varies by platform and traffic — contact for a quote for help deciding what belongs at the edge versus a region.