March 30, 2015
This is the first post in a series of blog posts, entitled Riak Customer Stories, where we will look at common use cases for Riak and their applicability in specific verticals. Our first customer stories will focus on how Riak is helping Gaming companies achieve massive scalability.
Online gaming continues to grow in popularity, whether for huge gaming communities like Riot Games’ League of Legends or gaming sites like bet365, one of the world’s leading online gambling groups. This growth is forcing changes to existing infrastructure in order to keep up with demand and innovation. Traditional relational databases can’t meet the requirements for massive scalability, speed, and fault tolerance
Innovation is critical to retain long-term customer loyalty and is changing the way gamers play online. These changes include the move away from single bets on an event to in-game betting on an ever-increasing range of metrics. The advent of regional gaming competitions, like the League of Legends World Championship with an annual grand prize of $1 million, show just how far gaming has come.
Gaming on Riak
Companies who build games or betting sites use Riak in three key ways:
- Player Data – Riak provides low-latency, highly available data storage for key player data, including user and profile information, game performance, statistics and rankings, and more. Riak also provides many different tools for querying and indexing this data, such as a full-text search engine and secondary indexing.
- Session Storage – Riak is used to store and serve session data with predictable low-latency, which is necessary for game play. Riak imposes no restrictions on the type of content stored (since all objects are stored on disk as binaries), so session data can be encoded in many ways and can evolve without administrative changes to schemas.
- Global Data Locality – While gaming, players require a low-latency experience, regardless of their physical location. Interrupted or slow game play can lead to poor user experience and player abandonment. Riak Enterprise’s multi-datacenter capabilities allow game data to be physically close to players and for fast response times regardless of player location.
- Social Information – Riak is built for very fast data storage. Due to its inherent design and Riak’s simple key/value data model, Riak is ideal for storing and serving social content such as social graph information, player profiles, player relationships, social authentication accounts, and other types of social gaming data.
By using Riak, companies have achieved global availability, massive scalability, while still maintaining operational simplicity These benefits are derived from the core architectural decisions made in the design of Riak.
By design Riak is masterless. Each node in a Riak cluster is the same, containing a complete and independent copy of the Riak package. There is no “master” or coordinating node. This uniformity provides the basis for Riak’s fault-tolerance and scalability. When this is coupled with an even distribution of data around the cluster via consistent hashing, there is a significant decrease in risky “hot spots” in the database while lowering the operational burden associated with manually sharding data. In addition, new nodes can easily be added with automatic, minimal redistribution of data.
This distribution of data in a masterless system is supplemented with a process of “hinted handoff”. Hinted handoff lets Riak cleanly handle node failure. If a node fails, a neighboring node takes over its storage operations. When the failed node returns, any updates received by the neighboring node are handed back to it. This ensures availability for writes and updates and happens automatically.These are discussed in greater detail in a blog post entitled Why Riak Just Works.
Modeling Gaming Applications in Riak
The table below illustrates key/value mappings for common application types. Remember that values in Riak are opaque and stored on disk as binaries – JSON or XML documents, images, text, etc. Riak has a “schemaless” design. Objects are comprised of key/value pairs, which are stored in flat namespaces called “buckets.” The way data is organized in Riak should take into account the unique needs of the application, including access patterns such as read/write distribution, latency differences between various operations, use of Riak features (including MapReduce, Search, Secondary Indexes), and more.
Here are some common approaches to structuring gaming data with Riak’s key/value design:
|Player Data||Login, email, UUID||Player Attributes (often stored as a JSON document); Player Rewards and Stats|
|Social Data||Login, email, UUID||Player Profiles, Social Graph Information, Facebook/Twitter Tokens|
|Session Information||User/Session ID||Session Data|
|Image or Video Content||Content Name, ID, or Integer||.JPG, .PNG, .GIF or other image format; .MOV, .MPG, .MP4 or other video file format|
Gaming Customer Stories
In a recent webinar, Dan Macklin, Head of Research and Development at bet365, provided an overview of their decision making process in choosing Riak. As one of the world’s leading online gambling groups, with over 18 million customers in two hundred countries, bet365 has a unique perspective on making an informed, strategic decision when designing an always available application architecture.
In this webinar, Dan discussed:
- bet365’s journey to Riak
- The evaluation and technical challenges being addressed
- The triumphs of migrating to Riak
- Advice for anyone evaluating their database requirements
bet365 was faced with a massive scale issue. Their existing SQL, relational database solution was simply unable to keep up with the demand placed on it by their infrastructure without needed to incur the complexity and cost of sharding. The lack of scalability was causing undue stress on their infrastructured leading to a loss of availability. Of particular interest, for those sharing a similar decision making process, is that Dan discusses not only their search for a solution but their decision making process that ultimately identified Riak
The session is available for replay here.
At RICON 2014, Basho’s distributed systems conference for developers, Michal Ptaszek gave a session entitled Let’s Chat About Chat. This session provided detailed insight into how Riot Games built their League of Legends chat system with Riak to handle 70 million players.
In League of Legends, just as in any competitive team game, communication is essential to success. Therefore, when building Chat for the game we had to make sure that the new service would be absolutely rock solid in every respect. This includes not only guaranteed message delivery and consistent presence propagation across the system, but also maintenance of the created social network graph.
In this talk I would like to present how we achieved linear scalability for Chat, improved its overall fault tolerance, and got ready for the new features we wanted to ship. I will also discuss in detail why we migrated our data from MySQL to Riak and how we used CRDTs to deal with conflicting object updates.
As is thematic in gaming use cases, database scalability was a primary consideration and was an architectural consideration from the start. Riot Games started their application modeling with MySQL –a relational database– but hit multiple performance, reliability, and scalability issues. As an example, it simply was not possible to update the database schema fast enough to track changes made in code.
In addition, Riot Games leverages the multi-datacenter capabilities off Riak Enterprise to export persistent data to a secondary Riak cluster. Costly ETL queries, like social graph queries, are run on the secondary cluster without interrupting the primary cluster. This design pattern is often referred to as a “Secondary Analytics Cluster”.
Some statistics that highlight the immense scale that Riot deals with:
- 67 million unique players every month (not counting other services using chat)
- 27 million daily players
- 7.5 million concurrent players
- 1 billion events routed per server, per day, only using 20-30 percent of available CPU and RAM
- 11K messages per second
- A few hundred chat servers are deployed around the world. Managed by 3 people
- 99% uptime
To learn more about Riak in the Gaming and Gambling industry, there are several useful resources to begin your research and design your deployment.
- Riak Solution for Gaming – This Solution Brief discusses using Riak for a variety of gaming and gambling use cases.
- Riak Tech Talk – Our experienced team can help develop your use case, answer questions, and make sure you are successful at every step from development to production. We can arrange either in-person or virtual meetings, depending on availability and location.
- Why bet365 chose Riak – Get a better understanding of how to make informed strategic decisions directly from someone who has taken the journey. Dan Macklin, Head of Research and Development at bet365 will show you how. His story about choosing Riak will captivate anyone that needs to ensure their data is always available.
London, Sept. 9 2014 – the Spine – the electronic backbone of the UK’s National Health Service – has been successfully rebuilt to harness new technology, including the use of Basho Technologies’ distributed database, Riak Enterprise.
The Spine – a collection of national applications, services and directories – connects clinicians, patients and local service providers throughout England to essential national services, such as electronic prescriptions and patient health records.
Spine is used by more than 20,000 organizations that provide health care across England, including primary and secondary care sites, pharmacies, opticians and dentists. Riak, the open source distributed database, is key to providing the reliability and scalability for the platform to drive efficiency and improve patient care.
The NHS’ move to revamp the Spine, in a major project led by England’s Health and Social Care Information Centre (HSCIC), was driven by the need for a scalable, resilient and flexible system that would also result in cost-savings for the organization.
With these requirements in mind, the NHS selected Riak Enterprise, the commercial version of Basho’s distributed open source, highly available NoSQL database, to support the transition and implementation of the new Spine. Basho and the HSCIC collaborated throughout to ensure the technical knowledge of both organizations was reflected in enhancements to Riak and the wider project itself.
Riak has been tested thoroughly over the past year and will also allow the NHS to update the Spine seamlessly, removing interruptions which could adversely affect NHS employees and patients.
The transition was finalised over the weekend of 22nd August, 2014, with the infrastructure undergoing a 45-day period of intensive monitoring to ensure that it is performing as expected.
“The improvement of patient care is of the utmost importance in the healthcare industry. As data, such as patient records, prescriptions and all other medical information becomes digitized, it is vital that government health organizations can adapt and provide constant, reliable access to this information,” said Adam Wray, CEO at Basho Technologies.
Stuart McCaul, Managing Director, EMEA at Basho Technologies said, “The information stored on the Spine is potentially life-saving, and so users must be able to quickly access the data they require without delay or complication. Riak has previously been adopted by other healthcare services outside of the UK, such as The Danish Health and Medical Authority, and it provides the Spine with resiliency and predictable scalability while also saving the NHS both time and costs, contributing to the improvement of patient care in England.”
About Basho Technologies
Basho is a distributed systems company dedicated to making software that is highly available, fault-tolerant and easy-to-operate at scale. Basho’s distributed database, Riak, the industry leading distributed NoSQL database, and Basho’s cloud storage software, Riak CS, are used by fast growing Web businesses and by one third of the Fortune 50 to power their critical Web, mobile and social applications and their public and private cloud platforms.
Riak and Riak CS are available open source. Riak Enterprise and Riak CS Enterprise offer enhanced multi-datacenter replication and 24×7 Basho support. For more information, visit basho.com.
# # #
March 17, 2014
This week is the Game Developers Conference (GDC) in San Francisco. GDC is the largest, professionals-only game industry events and brings together programmers, artists, producers, game designers, audio professionals, business decision-makers, and more to exchange ideas and shape the future of the industry. Basho is a proud sponsor of GDC and this is our second year speaking and exhibiting at the event.
On Thursday, March 20th, join us for the session, “Riak for Games,” presented by Quark Games and Basho. The talk will be about database choices, mistakes, successes, and lessons learned by the presenters: Eric Liaw and Seth Thomas. Eric, Co-Founder at Quark Games, will give insight from five years of mobile game development. Seth, Technical Evangelist at Basho Technologies, will give insight from his time at Vigil and SOE, as well as success stories from current Riak customers. Their talk will be at 11:30am in Room 3020, West Hall.
In addition to this session, Basho will also be exhibiting. Be sure and stop by our booth to talk Riak and pick up some great swag.
Riak is an ideal solution for many gaming use cases, including storing session data, player stats, and user profile information. For more information on how companies like Rovio, Riot Games, Hibernum, and Mochi Media use Riak, check out our Riak Users Page. To learn more about why Riak is a fit for gaming, download our whitepaper, “Riak on Gaming.”