Understanding CDN: Principles, Architecture, and Applications
This article explains the fundamentals of Content Delivery Networks (CDN), covering their history, DNS-based operation, global load balancing, caching mechanisms, typical use cases such as website and streaming acceleration, and the performance, cost, security, and operational benefits they provide.
In today's Internet, services like e‑commerce, portals, live streaming, and games rely heavily on Content Delivery Networks (CDN) to deliver content efficiently to users.
CDN originated from a research problem posed by Tim Berners‑Lee in the 1990s, which was later commercialized by Tom Leighton and others into the first CDN company, Akamai.
According to Baidu, a CDN is an intelligent virtual network built on the existing Internet that uses edge servers, load balancing, content distribution, and scheduling to bring content closer to users, reducing congestion and improving response speed.
In simple terms, CDN enables users to access resources from nearby edge nodes, achieving optimal access efficiency.
Without CDN, a user requesting a video would have to retrieve it directly from the origin server, causing higher latency and load.
This scenario leads to problems such as cross‑operator latency, increased round‑trip time over long distances, and overwhelming the origin server with massive requests.
CDN relies on DNS, using two key record types:
A record : maps a domain name to an IP address (e.g., www.test.com → 10.10.10.10). When a client resolves the domain, the DNS server returns the IP.
CNAME record : creates an alias from one domain to another (e.g., www.aaa.com → www.bbb.com). The client first resolves the alias, then resolves the target IP. This is commonly used to delegate DNS resolution to third‑party services such as CDN providers.
Without CDN, the domain is typically configured with an A record pointing directly to the origin IP, so client requests go straight to the origin.
When CDN is used, the domain is configured with a CNAME that points to the CDN provider’s domain; the provider’s Global Server Load Balancer (GSLB) then assigns the optimal edge node IP, and the client’s request is directed to that edge node.
The CDN acceleration function is mainly realized by two subsystems: GSLB and the caching system.
GSLB (Global Server Load Balancer) uses intelligent DNS techniques to select the best node for a user based on configured policies.
Common GSLB scheduling strategies include:
Static scheduling based on local DNS IP region.
RTT‑based scheduling, selecting the node with the smallest round‑trip time.
Cost‑ and bandwidth‑based scheduling, balancing deployment cost and node bandwidth.
Service‑level scheduling, giving higher‑quality nodes to premium customers.
CDN providers often combine several strategies to achieve optimal node selection.
Cache system consists of many cache nodes that directly serve user requests from locally stored content and synchronize with the origin to fetch missing or updated resources.
Cache architectures can be multi‑level, such as a three‑tier model: edge nodes closest to users, regional nodes, and a central node; if a request misses at the edge, it climbs the hierarchy before finally pulling from the origin.
CDN application scenarios include:
Website acceleration for portals and e‑commerce.
File download acceleration for large software packages or game installers.
Streaming acceleration for live and on‑demand video services.
Full‑site acceleration for dynamic content using smart routing and protocol optimization.
Benefits brought by CDN :
Cost savings: high cache hit rates reduce bandwidth and server requirements, and pay‑as‑you‑go models avoid over‑provisioning.
Improved user experience: reduced latency prevents users from abandoning pages (the “8‑second rule”).
Enhanced security: CNAME masking hides origin IPs, mitigating DDoS attacks, while distributed nodes absorb traffic spikes.
Reduced operational complexity: providers offer integrated monitoring, analytics, and tools, allowing teams to focus on core business.
Appendix: CDN terminology
Accelerated domain: a domain that uses CDN acceleration.
Edge node: a cache server that provides nearby access to users.
Hit rate: the proportion of requests served from cache rather than the origin.
Origin pull (回源): fetching resources from the origin when they are not cached.
Pre‑warm: proactively loading specific resources into CDN caches.
Purge (刷新): deleting cached resources so that subsequent requests fetch fresh content from the origin.
DevOps Operations Practice
We share professional insights on cloud-native, DevOps & operations, Kubernetes, observability & monitoring, and Linux systems.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.