What is a CDN? — Learning With Ankit

Ankit Kumar
3 min readAug 5, 2022

--

Hello,

Please subscribe to my newsletter: https://jinxankit.substack.com/p/what-is-a-cdn-learning-with-ankit?sort=new

There are 2 types of engineers in the industry, those who develop and build cool applications and scalable systems and one who does both building and sharing their knowledge with the community using blogs, side projects, videos etc. I like the 2nd type.

Today I started a newsletter with substack to share my learning of system design and coding with you all.

So Day 1, I am so excited, I am doing this, yayyyyy

Today I was Learning about What is a Content Delivery Network (CDN), How does it work? Do we need it at all?

CDN Stands for Content Delivery Network. It is used to connect with our users existing anywhere on the planet, whether you are working in your store, office, or playground. You have your application/product to sell online, you want to deliver your product images to your customers at an appropriate speed else your business suffers.

A CDN allows you to send your assets quickly which is needed for loading Internet content including HTML pages, CSS, images and videos. It is growing day by day as the web traffic is served through CDNs, including traffic from major sites like Amazon, Netflix, Flipkart etc.

So my next question would be How is it different from Caching?

Caching is the process of storing information for a set period of time on a computer, While CDNs are geographically distributed networks of proxy servers and their objective is to serve content to users more quickly.

The major difference between them is that CDNs perform caching, not everything that performs caching is a CDNs.

How does a CDN work?

A CDN is specifically a network of proxy servers that are usually in multiple locations that cache website content. The goal of CDNs is to deliver content efficiently, and they act as a layer between the user and the server. This prevents all requests from going to the same server. The CDNs proxy servers distribute the requests spatially in relation to the end-user across the globe. for e.g.

If you visit a site (example.com) before, the caching rule on your chrome says, This page has been updated, It means the request will have to go to the origin server, if you are based in New Delhi, India, the origin server is in Japan that’s a long call. However, a CDN knows to retrieve the content from the site every time it’s updated. The updated site is now cached at the closest CDN server in Singapore. So now it will reduce the time for subsequent visits.

There are many CDN services. The most popular are Cloudflare, Akamai, MaxCDN (now StackPath), kubeCDN etc

  1. Improving website load times: CDNs can reduce the amount of data by reducing file sizes using algorithms like minification and file compression. Smaller file sizes mean quicker load times. A CDN lets users connect to a geographically closer data centre. Less travel time means faster service.
  2. Reducing bandwidth costs: CND reduce bandwidth costs
  3. Increasing content availability: The Divide and Conquer design of CDNs can help mitigate the load by distributing requests and serving pages quickly thanks to caching. Even if the main server goes down for some reason, the site won’t go down for everyone due to the cached version hosted on the CDN’s node servers.
  4. Improving website security: The layer of abstraction CDN servers offer help to keep security attacks away from your site’s main server. Edge servers are typically equipped with a Web Application Firewall that can filter out malicious incoming and outgoing requests. The firewall can analyse the request at the edge and block them right away.

Thank you, I will try to post my learning daily. Hope you have a great time.
Follow my newsletter: https://jinxankit.substack.com/p/what-is-a-cdn-learning-with-ankit?sort=new

Originally published at https://jinxankit.substack.com on August 5, 2022.

--

--