What is a CDN? Why Use a CDN?
November 16, 2025
When developing systems or preparing for system design interviews, developers inevitably encounter the question of how to speed up website and content loading. For instance, designing platforms like Netflix or YouTube with video content as the primary focus, or social networks like Instagram with vast amounts of images, loading speed becomes critical. Research has shown that for e-commerce websites, every additional second of user wait time increases the bounce rate significantly.
How can we accelerate website loading and resource delivery (videos, images)? CDN is a common solution. In this article, we'll discuss what CDN is, how it works in detail, and how to apply it in system design.
What is a CDN?
CDN stands for Content Delivery Network. Its core purpose is to enable users to access web content more quickly. If we break down these terms further, first CDN is a network, meaning it consists of many nodes (servers). Netflix's famous Open Connect CDN consists of over 6,000 locations and more than 18,000 servers worldwide.
After understanding that CDN is a network, let's examine "content delivery." While networks can serve many purposes, a CDN network specifically focuses on content delivery, more precisely delivering static resources (static content).
Common static resources delivered via CDN include:
- Images: Place website image resources (JPG, PNG, GIF, etc.) on a CDN to allow users to fetch from the nearest CDN node, reducing image loading time.
- Video and Audio: Store video content (MP4, HLS, etc.) on CDN to enable smooth playback from the nearest node, reducing buffering and stuttering.
- HTML, CSS and JavaScript files: Distribute website HTML, CSS, and JavaScript files via CDN to reduce loading times for these resources.
- Font files: Store font files (like Google Fonts or custom fonts) on CDN to help users load fonts faster and avoid delays from waiting for font loading.
Why Do We Need CDN? What Are the Benefits?
After understanding the CDN definition, readers naturally ask: why do we need CDN? What benefits does it provide? Why would Netflix invest over a billion dollars in building their Open Connect CDN system?
As mentioned at the beginning, one key function of CDN is to enable static content to reach users more quickly.
To understand this, we must consider the physical world behind software. Although the software we write is digital and virtual, we must still obey the laws of physics. Specifically, when content on a server—whether HTML, CSS, and JavaScript files for rendering webpages, or videos on streaming platforms and photos on social networks—needs to be transmitted to clients, transmission is still constrained by physical laws.
The most fundamental rule is: given the same transmission speed, longer distances mean longer transmission times.
Take Netflix, an American company. Without CDN, if Netflix placed its content servers in the US, viewers in Taiwan would need to wait for transmission across more than 10,000 kilometers. This would result in fast loading for US-based viewers but slow loading for Taiwan-based viewers.
However, if nodes were available worldwide, enabling content to be delivered locally to users, everyone would experience fast Netflix loading (technically speaking, low latency) regardless of location.
Think of CDN like a desk drawer at work. Most people place frequently-used files on their desk for quick access, rather than walking to a shelf to retrieve them every time. If retrieving a file requires walking to another room, the process takes longer.
In fact, from a content delivery website perspective, when a user browses a page like ExplainThis's Instagram homepage—covering request sending, server processing, database interaction, and returning the page's images—the entire process typically completes in tens of milliseconds since no complex logic is involved.
However, if an image request travels from Taiwan to the US, and the US server returns the image, it might take 200 milliseconds just for transmission. In other words, without nearby CDN nodes, the biggest latency bottleneck in the entire process likely falls on image transmission time.
Other Benefits of CDN
Beyond shortening physical distance to reduce transmission time, building a CDN system with multiple globally distributed nodes provides additional benefits.
With multiple nodes, the static resource delivery server no longer becomes a single point of failure. Imagine if only one server provided static resources with no backup nodes. If natural disasters affected the server's location, rendering it non-functional, the entire system would lose static resource delivery capability.
Conversely, with a CDN network, static resources replicate across nodes. If one server fails, others continue functioning, preventing single point of failure.
Besides avoiding single points of failure, another benefit of multiple nodes is the ability to distribute request load concentrated on one server. In other words, the CDN network's existence represents horizontal scaling for static resources. Consider Netflix—videos occasionally go viral globally (like the Squid Game phenomenon). In such cases, even a single server with excellent hardware specifications would struggle with massive global requests. With CDN's other nodes, traffic distributes effectively, preventing server overload.
Finally, a common additional CDN benefit is enhanced protection. CDN provides DDoS protection services that defend against distributed denial-of-service attacks, protecting website stability. Specifically, because the origin server's location remains hidden behind the CDN, any DDoS attack must first pass through the CDN. Given the CDN network's global distribution, successful attacks become extremely difficult.