Cache sharding is a technology that allows servers in the same data center to use one another’s caches. As a result, the number of unique files in the cache grows, the number of requests to the origin decreases, and the speed of content delivery increases.
Without the cache sharding feature, the CDN server checks if the file is in its cache when receiving a request from a client. If there is one, it gives it back, if there isn’t, it asks the origin for the file.
When there are many servers in the data center, this approach becomes disadvantageous: the same file can be stored in the caches of two or more servers, and if the request for this file comes to the third server, it will need to reclaim the file from the origin, which will take longer than reclaiming this file from the neighbor server.
To optimize the storage and distribution of content in data centers with a large number of servers, the caches of these servers are “combined”. Thus, when receiving a request, the server checks its cache, checks the neighbors’ caches and only then reclaims the file from the origin, if nothing is found.
The technology provides an advantage when delivering terabytes of content in case there are no obvious leaders in requests among these files (e.g. for online stores).
The more content is stored in the CDN cache, the faster it is delivered to end-users. When there is a lot of content, the issue of optimizing data storage is particularly acute, as it directly affects the main purpose of using CDN, which is ensuring high-speed delivery.
Cache sharding is just one of the many advanced features of our CDN that we have implemented to deliver content more conveniently and profitably around the world.