Content Delivery Network (CDN)
A CDN distributes content via a global network of edge servers to reduce latency and improve availability for web, video and API traffic.
Classification
- ComplexityMedium
- Impact areaTechnical
- Decision typeArchitectural
- Organizational maturityIntermediate
Technical context
Principles & goals
Use cases & scenarios
Compromises
- Misconfigured caches can serve stale content.
- Dependency on third parties can increase outage risk.
- Security issues at edge points can expand attack surface.
- Define clear cache rules and TTLs for different content types.
- Enforce TLS and security headers at the edge.
- Integrate automated invalidation strategies into deployment pipelines.
I/O & resources
- Assets to deliver (static/dynamic content)
- DNS access and domains
- TLS certificates and security configuration
- Edge-cached assets at PoPs
- Reduced origin load and bandwidth usage
- Monitoring data for latency and cache performance
Description
A content delivery network (CDN) distributes static and dynamic content across a global network of edge servers to reduce latency and improve availability. It accelerates delivery, offloads origin servers and provides load balancing plus geo-based optimizations. Use cases include websites, video streaming and API acceleration.
✔Benefits
- Lower latency via regional edge locations.
- Improved scalability during traffic spikes.
- Reduced origin load and bandwidth costs.
✖Limitations
- Not all content is easily cacheable (personalized, dynamic).
- Geographical coverage depends on the provider.
- Invalidation can become complex and costly.
Trade-offs
Metrics
- Time to First Byte (TTFB)
Time until first byte from edge/origin – indicator of latency.
- Cache hit ratio
Share of requests served from the edge cache.
- Origin bandwidth consumption
Bandwidth consumed by the origin server; shows CDN offload effect.
Examples & implementations
Use in an international e‑commerce platform
Global product images and static content are delivered via a CDN to reduce load times and avoid checkout outages during traffic spikes.
On‑demand video streaming platform
Video files and manifests are hosted at edge servers; adaptive bitrate and regional PoPs improve quality and availability.
API gateway with edge caching
Read-heavy API endpoints use edge caches to reduce response times globally and lower origin load.
Implementation steps
Analyze content and classify by cacheability
Select CDN provider based on PoP coverage and requirements
Configure DNS routing, TLS setup and cache policies
Test with load tests and validate cache hit rates
Set up monitoring and define invalidation/update processes
⚠️ Technical debt & bottlenecks
Technical debt
- Legacy cache rules not aligned with new content.
- Manual invalidation scripts instead of integrated CI/CD pipelines.
- Missing monitoring for cache hit rates and latency changes.
Known bottlenecks
Misuse examples
- Delivering personalized user pages via CDN without proper cache-control.
- Setting TTLs indefinitely and serving stale data.
- Serving sensitive data (PII) unencrypted through public edge caches.
Typical traps
- Unclear invalidation leads to hard-to-find errors.
- Misunderstandings about cache hierarchies between provider and origin.
- Excessive complexity due to differing provider features.
Required skills
Architectural drivers
Constraints
- • Legal constraints for geo-targeting and data sovereignty
- • Non-cacheable dynamic content limits benefits
- • Dependency on provider PoP locations