Last Updated: May 1, 2025
Edge Computing Layers
| Layer | Location | Latency | Examples | Best For |
|---|---|---|---|---|
| Device Edge | On the device itself | < 1ms | Sensor processors, phone ML, microcontrollers | Real-time control, offline-first, privacy-sensitive |
| On-Premise Edge | Factory floor, retail store | 1-5ms | AWS Outposts, Azure Stack, local K8s | Industrial IoT, retail POS, hospital systems |
| Network Edge | Cell tower, cable headend | 5-20ms | AWS Wavelength, Azure Edge Zones | 5G applications, AR/VR, autonomous vehicles |
| Regional Edge | Metro data centers | 10-50ms | Cloudflare, Fastly, Akamai CDNs | CDN, edge functions, A/B testing at edge |
| Cloud Core | Traditional cloud regions | 50-200ms | AWS us-east-1, GCP us-central1 | Heavy compute, big data, ML training, archival |
CDN & Edge Functions
Cloudflare WorkersJavaScript/TypeScript at 300+ PoPs. ~0ms cold start. WebSocket, KV, Durable Objects. Deploy globally in seconds.
AWS Lambda@EdgeNode.js/Python at CloudFront edge locations. Trigger: Viewer Request, Origin Request, Origin Response, Viewer Response. Max 30s execution.
Vercel Edge FunctionsNext.js edge runtime. Deno-based. Runs at Vercel's edge network. Great for SSR, API routes, A/B testing, geo-routing.
Fastly Compute@EdgeWebAssembly-based (Rust, JS, Go). Sub-millisecond cold starts. Full request lifecycle control. Advanced caching with VCL or custom logic.
Deno DeployEdge JavaScript/TypeScript. Built on Deno. Global by default. Web standard APIs. KV store, queues, cron jobs. Built-in observability.
Edge Patterns & Use Cases
| Item | Description |
|---|---|
Geo-Routing | Route 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 Authentication | Validate 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 Edge | Cookie-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 Preprocessing | Filter 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 Inference | Run 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
| Item | Description |
|---|---|
Latency | Edge: 1-50ms. Cloud: 50-200ms+. For real-time like autonomous driving or VR, edge is non-negotiable. |
Compute Power | Edge: constrained CPU/RAM (10ms-30s timeouts). Cloud: unlimited scale. Heavy ML training or big data = cloud. |
Data Residency | Edge: process locally, never send PII to cloud. GDPR/HIPAA compliant by design. Cloud: data crosses borders. |
Cost Model | Edge: per-request pricing (cheap for light compute). Cloud: per-second pricing (cheap for heavy compute). Cost favors running right workloads in right place. |
Offline Capability | Edge: works without internet. Cloud: internet required. Critical for factories, planes, remote oil rigs, agricultural sensors. |
Deployment Complexity | Edge: 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.