Summary
A CDN caches and delivers content near users. Edge computing runs logic near users, often on the same distributed edge network.
Interview Points
- CDN is primarily content delivery and caching.
- Edge computing executes code close to the user.
- Edge logic can handle personalization, redirects, auth checks, A/B routing, or lightweight APIs.
- Edge has runtime, cold start, data locality, and observability constraints.
- Do not move heavy stateful business logic to the edge without a strong reason.
2-3 Minute Interview Script
“A CDN is mainly about delivering cached content from locations close to users. Edge computing goes a step further by running code near the user.
CDN is great for static assets, images, and cacheable HTTP responses. Edge computing is useful for lightweight logic like redirects, geolocation routing, authentication checks, header normalization, personalization, or A/B experiments.
The tradeoff is constraint. Edge runtimes may have limited APIs, strict execution limits, and harder debugging. Data consistency can also be tricky if the logic needs central state.
Interview answer: use a CDN to reduce distance and origin load; use edge compute when request-time decisions need to happen close to the user.”
Follow-Ups
- What should not run at the edge?
- How does data locality affect edge design?