What is a Content Delivery Network
A content delivery network (CDN) refers to a network of geographically dispersed servers that work together to provide fast delivery of internet content. CDN is convenient for companies or organizations, which need to distribute huge file content to multiple users around the globe.
By leveraging either a company or a CDN vendor's private network through edge locations, also called Point of Presence, a content delivery network can significantly impact your application or website's performance, security, availability, and reliability. CDN vendors usually add a security layer to their service with DDoS protection and a Web Application Firewall (WAF).
How does it work
Consider an example of having media files that you distribute globally through your website hosted in Australia. Users in India will probably encounter latency issues while accessing the website due to the distance between both endpoints and the internet connectivity. To minimize the latency and increase users' experience, you can leverage a content delivery network. A CDN caches copies of your static content at the edge locations, reduce the load on your backend, improves read performance, and allows users to access that content faster.
Edge locations are closer to the user and located in between the user and the source. The first user who will request to access your content will retrieve it from the CDN. However, because the content is still at the source and not at the CDN level, this is a "Cache Miss." The CDN will then use a private network, a dedicated connection faster than the internet, to go to the source, grab the content, cache it at the edge location, and serve it to the user. You can then set a time to live (TTL) on the new cache content to allow the next group of users to access the content directly from that edge location. A "Cache Hit" allows you to reduce the CDN trip to the source thus, significantly reducing the latency and improving speed.
WAF is a service integrated with CDN, which will protect your web applications against common attacks. CDN also provides that security layer to your network by enforcing HTTPS connections between edge locations and your origin server.
What is it used for
A content delivery network is an excellent tool for static content that must be available everywhere. Suppose you want to distribute paid share content to premium users over the world. In that case, you can use CDN to create policies that include URL expiration, IP ranges to access the data from, and trusted signers.
Integrated with CDN, Geo Restriction allows you to restrict your content distribution by "Whitelisting" approved countries or "Blacklisting" banned countries. CDN also allows you to restrict your content accessible to a particular city, thus giving you more control over your content delivery.
Thank you for your time. I hope you enjoyed this.
Yvan, the Architect.