Logo

dev-resources.site

for different kinds of informations.

CDNs in Distributed Systems: Beyond Caching for Better Performance

Published at
1/12/2025
Categories
techtalks
distributedsystems
softwareengineering
systemdesign
Author
ujjwall-r
Author
9 person written this
ujjwall-r
open
CDNs in Distributed Systems: Beyond Caching for Better Performance

A CDN (Content Delivery Network) is a network of servers distributed across the globe. These servers store copies of website content and deliver them to users from the nearest location, improving speed and reliability while reducing the strain on the original website's server.

In this post, we will explore and understand the lesser-known but highly significant benefits of CDNs.

CDNs are not just for caching static content from the original serverβ€”they act as a layer over the internet, enhancing its design and performance.

Benefits of CDNs

CDNs form the underlying network substrate. The internet was not designed with today's performance expectations in mind. The more hops involved in a data transfer path from one system to another, the higher the cost, according to the original internet design. It did not account for factors like latency and congestion.

This is where CDNs play a crucial role by reducing latency or response time and increasing bandwidth.

How do CDNs improve latency?

CDNs are placed at multiple geographical locations and are accessed by nearby client systems.

Image description

A common method to find the closest server requested by a client is through global DNS load balancing. The request includes the client's IP address, and the DNS returns a list of nearby CDN servers along with their health status. (CDNs are essentially reverse proxies. Read more about server side caching in this article.)

CDN servers are also integrated into ISPs (Internet Service Providers). For instance, JioFibre and Airtel are popular ISPs in India.

Image description

CDNs use optimized routing algorithms within their overlay networks to select the fastest and least congested paths for data transfer. These algorithms leverage real-time updates on network health, such as traffic levels and server load, ensuring reduced latency and dynamic rerouting when congestion occurs.

For example, if a particular path becomes congested or experiences high latency due to heavy traffic, the routing algorithm dynamically reroutes the data through a faster, less congested path.

How do CDNs improve bandwidth?

To understand bandwidth improvement, consider the concept of RTT (Round Trip Time). CDNs decrease RTT. You can read about congestion window size and TCP optimization in my previous article.

Image description

CDNs leverage TCP-level optimizations. For instance, they can increase the congestion window size, thereby improving bandwidth.

Caching as a benefit of CDNs

CDNs cache the static content of the original server's responses. Learn more about server-side caching in my previous article.

This caching is multi-layered. The edge layer, or the first layer, is distributed across several geographical locations.

Naturally, the more edge clusters there are, the lower the likelihood of finding cached data in a specific edge cluster. This likelihood is referred to as the cache hit ratio. A lower cache hit ratio increases the load on the original server. To address this, additional intermediate layers of clusters are added. These intermediate layers are deployed in fewer geographical locations.

Conclusion

In summary, CDNs are not only used for caching static content but also for speeding up the delivery of dynamic resources from the original server.

Here are links to my previous posts, which I publish every Sunday on distributed systems:

Feel free to check them out and share your thoughts!

systemdesign Article's
30 articles in total
Favicon
Rate limiting : Global, Tumbling Window, and Sliding Window
Favicon
Designing the Spotify Top K
Favicon
Building RelaxTube: A Scalable Video Transcoding and Streaming Application
Favicon
Token Bucket Rate Limiter (Redis & Java)
Favicon
RabbitMQ: conceitos fundamentais
Favicon
CDNs in Distributed Systems: Beyond Caching for Better Performance
Favicon
Designing an Internet Credit Purchase System
Favicon
Context vs. State: Why Context is King in Software Systems
Favicon
Just thought about starting
Favicon
Hinted Handoff in System Design
Favicon
System Design: The Art of Balancing Trade-Offs
Favicon
Do you want to learn about System Design? I think this is a great article for you to get started with.
Favicon
Exploring the Intersection of Systems Engineering and Artificial Intelligence: Opportunities and Challenges
Favicon
From Concept to Deployment: The Lifecycle of a Systems Engineering Project
Favicon
Database less OTP- A concept
Favicon
Telemetry and Tracing: A Comprehensive Overview
Favicon
Asynchronous transaction in distributed system
Favicon
Fixed Window Counter Rate Limiter (Redis & Java)
Favicon
Kickstarting Weekly System Design Deep Dives: Building Scalable Systems
Favicon
Database Scaling NLogN πŸ“ˆ
Favicon
Navigating the World of Event-Driven Process Orchestration for Technical Leaders
Favicon
Load balancer vs Gateway vs reverse proxy vs forward proxy
Favicon
Kong API Gateway Setup Basic to advance usages
Favicon
Finding the Right Microsoft Platform for Your Applications
Favicon
PRESTO card Metrolinx fare system
Favicon
A Simple Guide for Choosing the Right Database
Favicon
loved reading it. Well Researched, Crisp and Informative #SystemDesign
Favicon
HTTP Caching in Distributed Systems
Favicon
HTTP Status Codes Explained
Favicon
Understanding Networking Communication Protocols

Featured ones: