From Cache to Compute
classic edge: serves cached copies; misses travel to origin.
edge compute: YOUR CODE executes AT the edge location.
user ──15ms──► [edge: runs your function]
│ can now:
│ - transform requests/responses
│ - auth/route/personalize LOCALLY
│ - call origin only when truly needed
the shift: from "cache decisions made centrally" to
"logic distributed globally."
What Edge Compute Actually Is
deployment model: upload code once → replicated to ~300 POPs
execution model: serverless-style — no servers to manage,
scale is automatic (per-request isolation)
latency model: compute happens ~10-30ms from users
instead of ~100-300ms at a central region
platforms: Cloudflare Workers, Fastly Compute@Edge,
AWS Lambda@Edge/CloudFront Functions, Akamai EdgeWorkers
all share a shape: V8-isolate-class runtimes, sub-millisecond
cold starts, aggressive per-request resource caps.
The Workloads That Belong There
| Workload | Why edge wins |
|---|---|
| Auth token verification | Reject bad requests before they cross oceans |
| A/B routing / personalization | Decision latency IS UX |
| Request/response transforms | Header rewrites, image negotiation |
| API aggregation for mobile | Parallel fan-out from near the user |
| Bot filtering / WAF logic | Attack mitigation at ingress |
| Real-time fan-out | Chat/presence relayed regionally |
pattern uniting them: SHORT, STATELESS, LATENCY-SENSITIVE.
anything needing >50ms CPU or heavy state doesn't fit —
see constraints below before falling in love.
The Constraints That Define It
✗ LONG CPU WORK: CPU-time caps (ms to low seconds)
✗ HEAVY DEPENDENCIES: small bundles; limited native libs
✗ LOCAL DISK: mostly none; storage is networked/KV
✗ TRADITIONAL DATABASES: connection pooling across 300 POPs
against central DBs = anti-pattern;
use HTTP APIs/caches/regional replicas
✗ STRONG CONSISTENCY: writes still need an authoritative region
edge compute EXTENDS the architecture (fast paths + gateways);
it does not REPLACE regions of record.
The Architecture Pattern
[user] ──► [EDGE: auth, routing, personalization, cache mgmt]
│ allowed & cacheable → serve locally
│ needs truth
▼
[REGIONAL CORE: databases, transactions, workers]
edge as intelligent filter + accelerator;
core as system of record. most successful edge deployments
are exactly this two-tier story.
Interview Framing
“Use edge computing for checkout?” tests constraint-awareness. Scored answer distinguishes layers: token validation and cart pricing DISPLAY at edge (fast reads), but payment AUTHORIZATION stays regional (consistency + compliance). Candidates who move everything to the edge fail; those who identify the fast-path subset pass. Name CPU/stateless constraints explicitly — that’s the depth signal.
Premium Content
Unlock Edge Computing and all premium lessons with a subscription.
All premium lessons
Ad-free experience
Priority support
From ₹199.99/year — See plans