...

/

Design a Content Delivery Network (CDN)

Design a Content Delivery Network (CDN)

Understand what a CDN is and how to design it.

What is a CDN?

A CDN is a group of geographically distributed proxy servers. A proxy server is an intermediate server between a client and the origin server. The proxy servers are placed on the network edgeThe network edge is the zone where a device or local network interfaces with the Internet.. Because the network edge is close to the end users, the placement of proxy servers helps quickly deliver the content to the end users by reducing latency and saving bandwidth. A CDN has added intelligence on top of being a simple proxy server.

Following are some of the advantages of a CDN:

  • Improves content delivery speed by leveraging a distributed network of servers.

  • Reduces server load by offloading static content delivery to the CDN.

  • Increases scalability and availability through load distribution and failover mechanisms.

  • Global reach and geo-targeting for faster and location-specific content delivery.

Press + to interact
Origin data center entertaining users' requests across the globe
Origin data center entertaining users' requests across the globe

Requirements

Let’s look at the functional and non-functional requirements that we expect from a CDN.

Functional requirements

The following functional requirements will be a part of our design:

  • Retrieve: Depending upon the type of CDN modelPush or pull., a CDN should be able to retrieve content from the origin serversAn origin server refers to the primary server that stores the original and authoritative version of a website or web application's content and data. It is the central source from which the content is served to users.. We’ll cover CDN models in the coming sections.

  • Request: Content delivery from the proxy server is made upon the user’s request. CDN proxy servers should be able to respond to each user’s request in this regard.

  • Deliver: In the case of the push model, the origin servers should be able to send the content to the CDN proxy servers.

  • Search: The CDN should be able to execute a search against a user query for cached or otherwise stored content within the CDN infrastructure.

  • Update: In most cases, content comes from the origin server, but if we run script in CDN, the CDN should be able to update the content within peer CDN proxy servers in a PoPA Point of Presence (PoP) is a physical place that allows two or more networks or devices to communicate with each other. Typically, each CDN PoP has a large number of cache servers..

  • Delete: Depending upon the type of content (static or dynamic), it should be possible to delete cached entries from the CDN servers after a certain period.

Non-functional requirements

  • Performance: Minimizing latency is one of the core missions of a CDN. The proposed design should have minimum possible latency.

  • Availability: CDNs are expected to be available at all times because of their effectiveness. Availability includes protection against attacks like DDoSIn DDoS attacks, malicious agents overwhelm the origin or application server by sending a massive number of requests..

  • Scalability: An increasing number of users will request ...