Technology

This blog post will help you understand what CDN Services are, why are they used, and what benefits they provide when delivering large-scale cloud-based applications. This blog also answers the question of whether your service requires a CDN or not, the different kinds of CDN service providers available on the market and should you use a CDN for your web services?

What is CDN?

Have you ever wondered how a high-definition movie on Netflix streams instantaneously and the numerous videos on the latest trend load before you scroll the page on Instagram even though these companies are based in the USA? This is all thanks to a Content Delivery Network used by these companies which are basically a group of servers that are geographically distributed and communicate with each other to provide fast delivery for web content.

While they may seem similar to each other in terms of functionality but CDN and web servers are different because a CDN server stores a cached copy of the content retrieved from the main web server for faster delivery and cannot replace a traditional web server.

Picture2-anant-1

While they may seem similar to each other in terms of functionality but CDN and web servers are different because a CDN server stores a cached copy of the content retrieved from the main web server for faster delivery and cannot replace a traditional web server.

What Problem Does CDN Solve?

To better explain this, we can take the example of a company that has its webserver hosted in New Delhi, India, and its users distributed across the country. As we can see from the diagram, the majority of the users are in the large metropolitan cities of India, and depending on the distance from the main server, each location has a varying latency for the web services (without CDN).

Picture3-anant-2

When these users access the web services, all requests are forwarded to the servers at New Delhi which means that a request to access a webpage from Hyderabad must travel 1550km towards the sever and then another 1550km back to the user which will result in a high round-trip time, in an ideal scenario would work without issues but as the services and users expand, the traffic increases which leads to a myriad of issues such as slow load times, increasing bandwidth costs and security challenges. All these issues can be resolved by deploying a CDN server at an IXP (Internet Exchange Point) or also known as PoP (Points of Presence) which is shown as the blue icon in the above image.

How Does CDN Work?

If I say a CDN server were to be used for Mumbai, then the default inbound gateway traffic for that region would be the CDN server. This is achieved by changing the root and/or subdomain level DNS configuration on the webserver to point towards the CDN server instead of the webserver.

Picture4-anant

The A-type record for the root domain “example.com” will be changed to point towards the CDN service’s IP address ranges instead of the actual server IP address and the sub-domain’s CNAME record will be modified to point to a CDN provided sub-domain name server address.

  1. The user sends a request to the DNS server to resolve example.com
  2. The DNS server recognizes the geographic location of the User-based on its Public IP address and to use the CDN services we have changed the A Record and CNAME to that of the CDN PoP so the DNS server resolves the URL to the IP address pointing towards the CDN PoP where the User eventually forwards the webpage request.
  3. If the CDN PoP does not have a copy for the requested webpage it first checks with other CDN PoPs for the webpage and ultimately the web server and stores the webpage in its cache.
  4. The CDN PoP then forwards the cached copy of the requested webpage to the user

Advantages of CDN

Picture5-anant-1

Load Time

We are all aware that a visitor will not stick around on a website that has long load times and the expectation to reduce the load times is constantly increasing. Combining this with the growing amount of web traffic it can be tough for a website to provide low latency but with a CDN placed close to the visitor and the content stored in high-speed storage (SSD/RAM), the visitors are likely to increase the website click rate leading to better sales and ad. revenue.

Bandwidth Cos

To match the requirements of the increased traffic a company will have to spend more money for its webservers bandwidth which is the prime cost in hosting. Using CDNs is not only more scalable but also a less expensive solution.

Uptime

If a lot of traffic is landing on a single web server, then the chances of hardware failure crashes and upgrade requirements will lead to longer and frequent downtimes which have a direct impact on revenue and customer perception. But with a CDNs distributed nature a website will have practically zero downtime and higher uptimes.

Security

The most common and disruptive threat to a website is a DDoS attack which can easily be mitigated with a CDN service with its distributed nature because there is no single point of failure. Also, security risks such as security certificates and load balancing can be provided by a CDN service.

Do You Need a CDN Service?

Yes, you do. Major players of all industries such as media and entertainment, e-commerce, social media, advertising, government, healthcare, and collaboration, etc. are already using CDN services for a decade. If you are looking to scale your online business and expect high volumes of traffic from various geographic locations, then CDN services will be imperative to ensure the successful scaling of your online business. There are multiple CDN service providers available, the most common of them being: Fastly, Cloudflare, Google, Amazon Cloudfront, and Imperva.

Wanting to increase your revenue through a faster, stable, and secure website is a noble thought but redirecting traffic of a complex web service can be a challenging task but with the experience in cloud-based deployments for all infrastructure types, the professional services offered at Zindagi Technologies, your CDN implementation can be as simple as giving us a call at +919773973971.

Author
Anant Seth
Network Security Engineer