Architecture

📖 2 min read 📄 Part 3 of 10

CDN Network - Architecture

Global Architecture

🌐 Users (Global) 🌍 GeoDNS / Anycast Routing Route to nearest edge · Health-based routing · Load balancing 🇺🇸 US-East L1 Cache + WAF 🔒 TLS Termination <1ms latency 🇪🇺 EU-West L1 Cache + WAF 🔒 TLS Termination <1ms latency 🇯🇵 Asia-Pacific L1 Cache + WAF 🔒 TLS Termination <1ms latency 🌏 Other Regions L1 Cache + WAF 🔒 TLS Termination <1ms latency cache miss 📦 L2 Regional Cache (SSD) <10ms latency · Shared across edge locations in region cache miss 🛡️ Origin Shield (L3) Collapse requests to origin · <50ms latency 🏠 Origin Servers Web servers · Application servers · Object storage 🔄 Cache Invalidation (Purge API)
CDN Global Architecture — Multi-tier cache hierarchy with GeoDNS routing and TLS termination at edge

Edge Location Components

  • Load Balancer: Distribute traffic across edge servers
  • Cache Servers: Store and serve cached content
  • WAF: Web Application Firewall for security
  • DDoS Protection: Mitigate attacks at edge
  • SSL/TLS Termination: Handle HTTPS at edge
  • Edge Computing: Run serverless functions

Request Flow

  1. User requests content
  2. GeoDNS routes to nearest edge
  3. Edge checks cache (hit → serve, miss → fetch from origin)
  4. Edge caches response
  5. Edge serves content to user

Caching Hierarchy

  • L1 (Edge): Memory cache, <1ms latency
  • L2 (Regional): SSD cache, <10ms latency
  • L3 (Origin Shield): Protect origin, <50ms latency
  • Origin: Source of truth, <100ms latency

Intelligent Routing

  • GeoDNS: Route based on user location
  • Anycast: Single IP, multiple locations
  • Health Checks: Route around failures
  • Performance-Based: Route to fastest edge
  • Cost-Based: Optimize for cost

This architecture provides global content delivery with low latency and high availability.