Skip to main content
networking

Edge Computing

Edge computing runs application logic at CDN edge locations (200+ PoPs) rather than centralized data centers. Cloudflare Workers, Deno Deploy, and Fastly Compute execute code within milliseconds of users. Eliminates origin round trips for dynamic content. Limited by: no persistent connections, short execution time, restricted APIs.

Definition

Edge computing moves computation from centralized origins to CDN edge nodes near users. Instead of routing every request across the internet to a single region, code executes at the nearest PoP – reducing latency from 100-200ms to 5-20ms for most users globally. Cloudflare Workers uses V8 isolates (same engine as Chrome) with <1ms cold start. Deno Deploy runs Deno/TypeScript at the edge. Fastly Compute@Edge uses WebAssembly for near-native performance. Use cases: personalization without origin round-trips, A/B testing at the edge, authentication/authorization checks, API response transformation, and geolocation-based routing. Limitations: no long-running connections (WebSocket requires origin), limited execution time (50ms CPU on Cloudflare free tier), restricted filesystem/network APIs, and data locality challenges (database must be edge-aware or accept latency to a central store). Edge databases (Cloudflare D1, Turso/libSQL, PlanetScale) solve the data locality problem.

Examples

  • Cloudflare Worker: addEventListener('fetch', event => event.respondWith(handleRequest(event.request)))
  • Deno Deploy: Deno.serve((req) => new Response('hello from edge'))
  • Vercel Edge Functions: export const config = { runtime: 'edge' }

Related Protocols

Related Terms