Skip to content
HLD Learn/Global-Scale Architecture

Edge Computing

4 min read

You'll learn to

  • -Explain what runs at the edge beyond simple caching

The CDN chapter back in Module 1 described edge locations purely as caches: serve a static file from nearby instead of round-tripping to the origin. Edge computing takes the same geographic idea and adds real computation to it: what if the edge could run actual code, not just serve cached bytes?

From Caching to Compute

Edge functions (Cloudflare Workers, AWS Lambda@Edge) let you run JavaScript or similar code at hundreds of edge locations worldwide: handling authentication checks, A/B test assignment, header rewriting, or simple personalization before a request ever reaches your origin servers. For a globally distributed user base, this can cut tail latency dramatically, because only genuine cache misses ever need to travel all the way to a single origin region.

Client
Edge Function
Origin

An edge function handles cheap, stateless checks (auth, A/B routing) close to the user; only genuine cache misses and heavier logic travel all the way to the origin.

Edge FunctionOrigin- only when genuinely needed

The trade-off is real: edge runtimes are deliberately constrained (limited CPU time, limited memory, restricted APIs), so only logic that's genuinely cheap and stateless belongs there; anything heavier still belongs in the origin region.

Interview Signal

Should you run your full user-authentication database lookup inside an edge function for lower latency?

Weak Answer

"Yes, running it at the edge means lower latency for every user."

Strong Answer

"Edge functions are deliberately constrained: limited execution time and memory, and typically no direct access to your main database across the world. A full DB lookup at the edge either isn't possible or reintroduces the exact cross-region round trip you were trying to avoid. What does belong at the edge is verifying a self-contained signed token (a JWT, from the Auth chapter), no database call needed, which is precisely why that pattern pairs so well with edge computing."

Check Yourself1 / 3

What does GeoDNS add on top of ordinary DNS?

Ready to Build This?

Level 42 (CDN Design) and Level 65 (Global CDN & Edge Computing Platform) are this module's exercises.

ScaleDojo Logo
Initializing ScaleDojo