0
0
HLDsystem_design~12 mins

CDN concept and usage in HLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - CDN concept and usage

A Content Delivery Network (CDN) is a system of distributed servers that deliver web content to users based on their geographic location. It improves website speed, reduces latency, and handles high traffic by caching content closer to users.

Architecture Diagram
User
  |
  v
+----------------+
|      CDN       |
| (Edge Servers) |
+----------------+
  |
  v
+----------------+
| Load Balancer  |
+----------------+
  |
  v
+----------------+       +------------+
|   Web Server   |<----->|   Database |
+----------------+       +------------+
Components
User
client
Requests content from the system
CDN
cdn
Caches and delivers static content from edge servers close to users
Load Balancer
load_balancer
Distributes incoming requests evenly across web servers
Web Server
service
Serves dynamic content and handles business logic
Database
database
Stores persistent data for the application
Request Flow - 8 Hops
UserCDN
CDNCDN
CDNLoad Balancer
Load BalancerWeb Server
Web ServerDatabase
Web ServerLoad Balancer
Load BalancerCDN
CDNUser
Failure Scenario
Component Fails:CDN
Impact:Users experience slower content delivery as requests go directly to origin servers, increasing latency and load on origin infrastructure.
Mitigation:System falls back to origin servers directly; origin infrastructure must be scaled to handle increased load until CDN is restored.
Architecture Quiz - 3 Questions
Test your understanding
What is the main purpose of the CDN in this architecture?
ATo balance load between web servers
BTo store user data permanently
CTo cache and deliver content closer to users
DTo process database queries
Design Principle
This architecture shows how a CDN reduces latency and load on origin servers by caching content close to users. It also demonstrates the importance of load balancing for distributing requests and the fallback mechanisms when caches miss or components fail.