Case studies How SportMonks increased their API performance to new heights

How SportMonks increased their API performance to new heights

Sportmonks

About SportMonks

SportMonks started out as a company under the name Soccerema with an idea for a web-based football game, soccer to those from the US, using real match results and player information. The game needed data of all football matches, players, location, games and a lot more.

While the game itself did not get a lot of players, we received a number of questions about our data. Due to the popular demand, we developed an API to our match data. This turned out to be the start of a new part in our story and how the data used for the game became the product. We pivoted to publishing and making the data available to all and so SportMonks was born.

We offer a public API to our sports data at SportMonks.com. Though we have our origins in football (or soccer), we are expanding to other sports like Formula 1 racing, Basketball, Baseball and Hockey to name a few.

With the help of a cloud hosting provider Twisted Bytes, we migrated our old servers from DigitalOcean, which struggled with the load, to a highly optimized set of cloud servers that are able to handle a lot more customers. We continue to get suggestions for ways to optimize the code and resources from Twisted Bytes. We are really happy about having chosen UpCloud and following up their recommendation to get in contact with Twisted Bytes.

Previous challenges

When we started the API, we had built everything by using the standard way to create and manage cloud servers from the framework we use, Laravel. But when the number of customers and API requests began to increase the servers started struggling to handle it all. In an attempt to cope with the increased demand we scaled up our backend to the extreme.

We are developers not system administrators or DevOps, therefore we needed somebody with the knowledge about squeezing every bit of performance out of the cloud servers. Because simply adding more resources will not always solve the developers’ problems.

After working with Twisted Bytes and UpCloud to migrate and tune our new cloud servers, it became clear that the old setup could have handled the load with better optimisation according to the size of the backend. But default setups do not provide the level of finesse required. We also needed someone who could take the time to monitor the application, the site, and the servers to see what is going on.

Hosting on UpCloud

We are using the basic services from UpCloud: high-performance cloud servers and of course their incredibly fast storage. We have not had much need for anything else because our systems are managed by Twisted Bytes. They monitor and track the growth of usage and will tell us when rescaling or additional resources are needed. Thanks to the stable configuration, we have not needed to add, remove, or resize our cloud servers very often. As such, our service’s costs are easily predictable.

Our setup consists of a load balanced set of API servers and of course a couple of hosts for the database, caching and other services. This setup enables us to adjust the backend capabilities when needed without any outages to the API. Any changes can be done fast and easy thanks to UpCloud’s simple web console.

Improvements

Our switch to UpCloud helped us to focus on developing the API to include more sports such as Formula 1. We are now sure the servers are taken care of by Twisted Bytes and UpCloud. And as developers, we can trust in being able to create the cloud servers we need to deploy our applications.

Although our old setup could have been optimized better, the new servers at UpCloud are so much faster on the disk, CPU, and memory performance. We get way more requests out of the same amount of money that the migration was well worth it. UpCloud tells you about their fast disks, but what they don’t tell you is that the CPUs they use are also faster than those you normally get with other cloud providers. An extra 700Mhz more per thread is something you will notice. But when your service grows big enough to need load balancing and high availability, you can either build your own environment or turn to a company like Twisted Bytes. We are very glad UpCloud recommended us to get in touch.

Future plans

At the moment we are running everything in one zone. But we are going to expand to more locations and that is going to need some global load balancing. We already have some ideas about that and are looking forward to getting it implemented.

In the long run, with the addition of the UpCloud’s Go API client, we would love to see support for tools like Terraform. It would make managing and documenting our servers at UpCloud even easier. In that way defining hosts would be as simple as writing a configuration file.

Manage your servers quickly and effortlessly using the UpCloud API.

Getting started with the UpCloud API

Locations

Helsinki (HQ)

In the capital city of Finland, you will find our headquarters, and our first data centre. This is where we handle most of our development and innovation.

London

London was our second office to open, and a important step in introducing UpCloud to the world. Here our amazing staff can help you with both sales and support, in addition to host tons of interesting meetups.

Seattle

Seattle is our 4th and latest office to be opened, and our way to reach out across the pond to our many users in the Americas.

Singapore

Singapore was our 3rd office to be opened, and enjoys one of most engaged and fastest growing user bases we have ever seen.