How Hadoop and in-memory analytics help make Candy Crush the world’s most addictive game

King Digital Entertainment has more than 195 games in over 200 countries and currently generates over one petabyte of data a year.

Analysing the data and acting on evidence generated by 1.5 billion game plays per day, rather than guesswork, gives King the edge over its competitors. It allows King to deliver a superior gaming experience, keeping its 149 million daily active users coming back for more.

To do this, King uses a combination of open-source Hadoop and an in-memory analytic database.

King uses its data to enhance its players’ experience, to constantly improve its games, and to drive innovation. Our ability to gain valuable insights from our data is at the heart of being a player-centric business.

>See also: In-memory computing: current state of play

Data helps us strike the right balance between challenge and fun in our games and see how, when and why people spend money in our games. We use this information to make small but vitally important improvements, making them more playable, whilst helping us to retain our loyal players and attract new players.

All our games are entirely free to play. Players come to us because they love our games. Our revenue comes from virtual items our players can purchase if they choose to.

In a competitive market when another game is just a few clicks away, we want to earn the loyalty of our players every time they play and provide a high quality experience. So we need to make sure we're making the most of our data to help create a perfect, well-rounded and balanced game.

The data challenge

Since King’s inception, the amount of data has increased exponentially, which has created a large challenge for data analytics. King started as a gaming website, moving onto social media and then mobile by November 2012. By the end of 2013, it had attracted 408 million active users.

Data is very important to King’s game development process and an analytics company EXASOL gives us a powerful tool to deliver the best possible experience for our players. The ability to analyse this data effectively, and get the answers we need, when we need them, is critical to our business.

An example is Level 65 of Candy Crush Saga. By careful analysis of the data, King noticed that players were getting stuck on level 65, possibly getting frustrated and leaving. This told us that change was required. People enjoy games because they are the perfect balance between challenging and fun. By making a small change to the level design the problem was solved.

Hadoop needs real-time analytics

The infrastructure we had in place prior to going mobile was all Hadoop-based and while we could have scaled Hadoop to get the speeds that we needed for our analysis, it would have required us to throw hundreds of servers and many more engineers at the problem – a costly prospect.

Hadoop was working to an extent, but it became clear that it was not the whole answer. Hadoop is very good at things like cost-effective storage of vast quantities of data, but not so good at rapid analysis. So we went looking for something that could complement Hadoop and address its weaknesses.

In addition, the status quo of lengthy waits for answers to queries and questions on the data was fast becoming a pea in the mattress. The business needed answers quicker to be able to react and stay ahead of its customers’ needs. It was important that whatever technology was implemented next could meet this criteria.

Any new technology needed to coexist with Hadoop and be able to ingest data from the Hadoop File System. It also had to be easy to evaluate as we did not want to waste time or money setting up expensive test infrastructure. Ideally, the data had to remain on site and once the database was in operation it needed to run itself. The new technology also had to be fast.

If the business had not continued to grow at such a fast pace, the first analytics database we implemented would have continued to work well for us. It proved to us that we were on the right track and that a hybrid approach – pairing Hadoop with an analytics database – could offer us the best of both worlds.

But the demands of scale were taking their toll and we needed a better solution, so we set about testing a variety of other providers.

The other benefit King has realised since combining Hadoop with an MPP database is that queries that used to take hours can now be done in just seconds and complex data processing tasks, previously thought daunting, completed with ease.

Having the right data available at the right time is vital for our users. Jobs that previously ran late into the afternoon are now finished and ready before anyone is even in the office. That's made a huge difference for our users and freed my team up to tackle even harder problems, handle more requests, and to be more responsive to the business.

>See also: A guide to data mining with Hadoop

Moreover, this architecture has allowed King to make data available to a wider audience within the business, and to departments that previously weren’t a focus. The business is using data in many more ways than it had been.

For example, the customer care team is now using data analytics to give loyal players an even better customer support experience. Previously, it was hard to see how this would have happened and King is now exploring the possibility of other systems and department teams making use of the company’s data to positively impact the business in different ways.

An in-memory MPP database combined with Hadoop allows my team to serve the business better, providing them with the data they need, in turn giving our players an incredible gaming experience.

Avatar photo

Ben Rossi

Ben was Vitesse Media's editorial director, leading content creation and editorial strategy across all Vitesse products, including its market-leading B2B and consumer magazines, websites, research and...