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!

softwareengineering Article's
30 articles in total
Favicon
Mastering Essential Software Architecture Patterns: A Comprehensive GuideπŸ› οΈ, Part 6
Favicon
Mastering Essential Software Architecture, Part 6 IS FINALLY OUT !!!!
Favicon
Stop Turning Your Code Into a Therapy Session for Past Bugs
Favicon
Things About Contexts in Front-end Projects
Favicon
πŸš€ Week 3 Recap: Learning in Public – Software Engineering with DevOps πŸš€
Favicon
5 Advanced Python Web Crawling Techniques for Efficient Data Collection
Favicon
7 Essential React Accessibility Strategies for Inclusive Web Apps
Favicon
5 Advanced Java Multithreading Techniques for High-Performance Applications
Favicon
Microsoft Project in 2025
Favicon
The System of UI Components in Front-end Projects
Favicon
Finding What Drives You
Favicon
Journey to Clean Architecture: Wrestling with a 10k Line Flutter Legacy Codebase
Favicon
An Initiation to Domain-Driven Design
Favicon
Things About Modules in Front-end Projects
Favicon
Binary embedding: shrink vector storage by 95%
Favicon
6 Advanced Python Techniques for Efficient Text Processing and Analysis
Favicon
Mastering CSS Grid: Expert Techniques for Responsive Web Design
Favicon
7 Essential Design Patterns for JavaScript Developers: Boost Your Coding Mastery
Favicon
CDNs in Distributed Systems: Beyond Caching for Better Performance
Favicon
Patterns of Directory Structure in Front-end Projects
Favicon
Emergent Software Principles I've Learned
Favicon
What I Learned After Coding for 24 Hours Straight
Favicon
Mastering Go's encoding/json: Efficient Parsing Techniques for Optimal Performance
Favicon
Reason for Talking About Front-end of Web-based Management Systems
Favicon
7 Powerful Python Libraries for Advanced Data Visualization: A Developer's Guide
Favicon
8 Key Strategies for Building Scalable Microservices Architecture
Favicon
The System of Front-end UI Components
Favicon
How a Software Developer's Life Is More Stressful Than You Think
Favicon
My Journey as a First-Year Software Engineering Student
Favicon
Code That Belongs in a Museum, Not a Repository

Featured ones: