Tricks behind PatchKit high availability

Piotr Korzuszek

17 May 2016

It’s not an easy way to build Content Distribution Network that will stay online and responsive at all times. We’d like to share some tricks behind PatchKit development on that topic.

title-image

The stability

To add new posts, simply add a file in the _posts directory that follows the convention YYYY-MM-DD-name-of-post.ext and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.

PatchKit.net CDN is working primary using a private Torrent network. Torrent network is know of its unbreakable stability. If there are seeds (computers that are sharing the content) and a way to download a torrent file, anyone will be able to get the content. This way even if half of our CDN servers will eventually go down, Torrent network will still be working and sharing files. Some network configurations may have torrent ports or protocol blocked, so we are also providing HTTP downloads as a fallback.

There’s one center point of PatchKit.net CDN and this is PatchKit.net application itself. As any thing in the world is can go down. Even if, CDN will still be working and your players will be still able to download your game even if you’re not be able to release a new version for a while. For this to work we’re using read-only API servers. Those servers are caching most frequent master server response until it’s back online.

The performance

What happens if you will try to distribute your content using server located in Europe? I believe European players will be happy. Because of close proximity of the server the download speeds will be satisfactory. But what about United States and Asia?

Our CDN consists of multiple servers all over the world to meet the demand of players of all nationalities. The process is completely transparent and automated, you don’t have to worry about anything and your players will get your game files as fast as possible.

The scalability

What happens with a CDN when game demand is high? Let’s say millions of downloads? Good CDN is able to handle this kind of traffic, so what about PatchKit?

All content and patch files have assigned priority in our CDN. There’s never a situation when a content or patch file resides only on a single server. New application version files are always sent to 6-10 locations all over the world. These values are adjusted dynamically based on actual demand.

What’s more, we’re using a private Torrent network for files distribution. Even in a situation when a demand spike exceeds out ability to distribute the content, players will be sharing it between themselves during the download process. Thanks to that practice, there’s small to none chance that players won’t be able to get the game.

API servers are backed up by AWS infrastructure, so even in scenario of high demand everything gets auto-scaled to a reasonable level.

Summary

PatchKit team is working long ours to make our service as robust as possible. In result we present a service that we’re really proud of.

Subscribe to our newsletter
and stay updated.