Edge Computing Architecture Cheat Sheet

Edge computing architecture and patterns — CDNs, edge functions, IoT gateways, fog computing, data locality, and the trade-offs between edge and cloud processing.

Last Updated: May 1, 2025

Edge Computing Layers

LayerLocationLatencyExamplesBest For
Device EdgeOn the device itself< 1msSensor processors, phone ML, microcontrollersReal-time control, offline-first, privacy-sensitive
On-Premise EdgeFactory floor, retail store1-5msAWS Outposts, Azure Stack, local K8sIndustrial IoT, retail POS, hospital systems
Network EdgeCell tower, cable headend5-20msAWS Wavelength, Azure Edge Zones5G applications, AR/VR, autonomous vehicles
Regional EdgeMetro data centers10-50msCloudflare, Fastly, Akamai CDNsCDN, edge functions, A/B testing at edge
Cloud CoreTraditional cloud regions50-200msAWS us-east-1, GCP us-central1Heavy compute, big data, ML training, archival

CDN & Edge Functions

Cloudflare Workers
JavaScript/TypeScript at 300+ PoPs. ~0ms cold start. WebSocket, KV, Durable Objects. Deploy globally in seconds.
AWS Lambda@Edge
Node.js/Python at CloudFront edge locations. Trigger: Viewer Request, Origin Request, Origin Response, Viewer Response. Max 30s execution.
Vercel Edge Functions
Next.js edge runtime. Deno-based. Runs at Vercel's edge network. Great for SSR, API routes, A/B testing, geo-routing.
Fastly Compute@Edge
WebAssembly-based (Rust, JS, Go). Sub-millisecond cold starts. Full request lifecycle control. Advanced caching with VCL or custom logic.
Deno Deploy
Edge JavaScript/TypeScript. Built on Deno. Global by default. Web standard APIs. KV store, queues, cron jobs. Built-in observability.

Edge Patterns & Use Cases

ItemDescription
Geo-RoutingRoute user to nearest backend region based on IP. Edge function reads CF-IPCountry header, redirects to region-specific origin. Reduces RTT by 30-70%.
Edge AuthenticationValidate JWT at edge before request hits origin. Reject invalid tokens at CDN layer. Reduces origin load and improves attacker DDoS resilience.
A/B Testing at EdgeCookie-based traffic splitting: 50% to origin-v1, 50% to origin-v2. No client-side flicker. Experiment runs without app code changes.
Edge-Side Includes (ESI)Compose pages from cached fragments at CDN. Static layout + dynamic user data. Varnish/Cloudflare: assemble personalized pages from shared cached components.
IoT Data PreprocessingFilter and aggregate sensor data at the edge before sending to cloud. Reduce bandwidth costs by 90%+: only send anomalies or 5-min rollups, not raw streams.
Edge ML InferenceRun TensorFlow Lite, ONNX Runtime, or edge-optimized models. Privacy-preserving (data never leaves device). Applications: voice assistants, visual inspection, predictive maintenance.

Edge vs Cloud Trade-offs

ItemDescription
LatencyEdge: 1-50ms. Cloud: 50-200ms+. For real-time like autonomous driving or VR, edge is non-negotiable.
Compute PowerEdge: constrained CPU/RAM (10ms-30s timeouts). Cloud: unlimited scale. Heavy ML training or big data = cloud.
Data ResidencyEdge: process locally, never send PII to cloud. GDPR/HIPAA compliant by design. Cloud: data crosses borders.
Cost ModelEdge: per-request pricing (cheap for light compute). Cloud: per-second pricing (cheap for heavy compute). Cost favors running right workloads in right place.
Offline CapabilityEdge: works without internet. Cloud: internet required. Critical for factories, planes, remote oil rigs, agricultural sensors.
Deployment ComplexityEdge: heterogeneous hardware, limited debugging, harder monitoring. Cloud: standardized, mature tooling (CloudWatch, Datadog, etc.).
Pro Tip: Edge computing is about data gravity — move compute to where the data is created or consumed. Not everything belongs in the cloud: if latency must be < 10ms, you're going to the edge.