13 Design a Content Distribution Network (CDN)
This chapter covers
- Discussing the pros, cons, and unexpected situations.
- Satisfying user requests with frontend-metadata-storage architecture.
- Designing a basic distributed storage system.
A CDN (Content Distribution Network) is a cost-effective and geographically-distributed file storage service that is designed to replicate files across its multiple data centers to serve static content to a large number of geographically-distributed users quickly, serving each user from the data center which can serve her fastest. There are secondary benefits, such as fault-tolerance, allowing users to be served from other data centers if any particular data center is unavailable. Let’s discuss a design for a CDN, which we name CDNService.
13.1 Advantages and disadvantages of a CDN
Before we discuss the requirements and system design for our CDN, we can first discuss the advantages and disadvantages of using a CDN, which may help us understand our requirements.
13.1.1 Advantages of using a CDN
If our company hosts services on multiple data centers, we likely have a shared object store that is replicated across these data centers for redundancy and availability. This shared object store provides many of the benefits of a CDN. We use a CDN if our geographically-distributed userbase can benefit from the extensive network of data centers that a CDN provides.
The reasons to consider using a CDN were discussed in section 1.4.4, and some are repeated here.