Jump to Content
Databases

Why should game companies choose Cloud Spanner to power their games

November 15, 2022
Pritam Shah

Director of Engineering

Tina Deng

Technical Writer

Try Google Cloud

Start building on Google Cloud with $300 in free credits and 20+ always free products.

Free trial

Organizations globally use Cloud Spanner, because of its unlimited scale, strong consistency, and up to 99.999% of availability. In particular, game companies, like Embark Studios use Spanner to help scale and solve the many challenges of a distributed system, such as concurrency and load balancing. 

According to a recent PwC report, the global gaming industry is one of the sectors that has experienced significant growth in the last couple of years, and the industry (excluding esports) is poised to be worth $321 billion by the year 2026. In the past three years alone, the industry has grown by half a billion players, totaling 2.7 billion players globally

It’s no surprise that game players seek an enriching experience that includes playing a variety of games, communicating with each other, and participating in out-of-game activities like watching game franchise movies, buying memorabilia, and more. Player expectations are rising and evolving and we see demand for cutting edge graphics, an immersive in-game storyline, multiplayer game interactions across the globe, and not to mention, 100% uptime. The right database is critical and essential to satisfy these requirements, and there are many factors for game developers to take into consideration when choosing the right database.

The importance of choosing the right database 

Creating a highly interactive, multiplayer game is not easy. It is in fact one of the most fascinating distributed systems problems. The game needs to ensure high uptime, low latency, ability to scale on demand and consistent experiences across geographic locations. It also needs to support sophisticated workflows, special events and tournaments, in-game purchases, in-game experiences - and the list goes on. And whether you’re creating the next blockbuster or indie favorite, you need to consider a plethora of design challenges and constraints like capacity forecasting for millions of players demanding real-time experiences. 

In the midst of it all is the key question: What database will solve the many challenges of a distributed system? For example, updating a live table that is currently serving existing users requires a lot of caution and careful planning. Is the table serving end user traffic? Is the database serving relatively high QPS, and is it going to prevent users from accessing the table? How important is “zero downtime” for your game and your brand? Do you need to relax some constraints, likely around serving slightly stale reads? Do you need to worry about consistency across all your nodes? Do you need to scale out the database? And so on. 

For a traditional database, the onus is on the game developers to design around all the constraints above, taking focus away from the game itself. Often, in order to work around the limitations of the database, the developers end up designing and building a game application logic that is incredibly complicated.

Another dimension that game companies have to take into account is the Total Cost of Ownership (TCO). How much do you need to spend on operating and maintaining the database? If it is a self maintained database, you have to take into account the database administrator, operational, and maintenance costs – not to mention the cost of patching and keeping security credentials up to date.

No matter your size, it’s incredibly important as a company to optimize your resources, both human and capital, to allow you to focus on your game rather than infrastructure maintenance. Having a robust, secure, and scalable infrastructure provided to you as a service means faster, easier, and better optimized game development cycles. Choosing the right database is one of the key success drivers behind a bestselling game.

Why Spanner is the best choice for powering game development backends

That’s where Spanner comes in as the database of choice for your game development needs. 

Here are the reasons why you should choose Spanner:

Spanner can solve many of the challenges of distributed transactions. As a fully-managed, globally distributed, and strongly consistent relational database with unlimited scale, Spanner is built for the cloud to combine the benefits of a relational database structure with non-relational horizontal scale. Spanner serves over 2 billion requests per second at peak without any downtime or maintenance windows. For game developers who often run smaller workloads or support a smaller user base initially and then expect to scale seamlessly, we’ve introduced granular instance sizing and committed use discounts. You can also get started at no cost with the Spanner free trial instance!

Spanner easily handles large unexpected workloads, allowing you to focus on your game. One of the biggest pain points that game developers face is building a distributed system that can respond to sudden changes in workload. A major concern for any game company is scalability: if their game goes viral globally, their infrastructure must be able to respond to sudden, incredible demands, while maintaining a consistent gamer experience and operational stability. Since Spanner automatically handles replication, sharding, and transaction processing, your game can quickly scale as needed to meet any unforeseen or spiky usage patterns. By using Spanner, you can truly enjoy all the benefits of relational semantics (Google Standard SQL and PostgreSQL-dialect databases) with unlimited horizontal scale, and allow your teams to focus on what matters most: the game itself.

Spanner can power gamers globally and provide them with a consistent experience. Spanner’s ability to provide clients with the strictest concurrency-control guarantees for transactions allows game companies to keep design patterns simple. Indeed, by using Spanner, you can focus your time and energy on solving the hard problems of game development rather than maintaining the database.

"With Spanner, the latency is so low between the regions that we can maintain a triple continent database. That means our players won’t have to choose between playing with their American friends or their European friends. They can just switch regions whenever they want," said Luna Duclos, a Lead Backend engineer at Embark Studios.

Spanner’s use cases in the gaming vertical are endless. Spanner can accommodate a wide range of database management functions, including:

  • Authenticating and authorizing players’ profiles.

  • Creating various stateful ingestion workflows from game clients, servers, and other applications.

  • Managing user, inventory, and profiles.

  • Implementing in-game purchases and leaderboards.

  • Storing and quickly serving players' data.

Below is a typical example architectural diagram of a popular game company, which uses Google Cloud to develop one of the world’s most popular online games.

https://storage.googleapis.com/gweb-cloudblog-publish/images/Figure_1__GCP_services_for_gaming_architec.max-1700x1700.png
Figure 1

Three Spanner features are especially important to game companies:

  • High availability: Spanner has incredibly high availability and latency guarantees that makes building reliable applications on top of Spanner simpler. Spanner provides transactional write support, assuring high robustness guarantees and industry-leading 99.999% availability for multi-regional instances. This high availability means that designing around the SLAs isn’t needed.

  • Backup and recovery management: Spanner’s backup management is easy to configure and offers point-in-time restoration to provide simplified business continuity. The backups are engineered to not have any impact on the serving traffic. Spanner also provides point-in-time recovery to make data fixing and the recovery of individual rows, tables, and whole databases simple, which is exceptionally useful when dealing with thousands or millions of transactions per day.

  • No cost to get started: The Spanner free trial instance lets you learn and explore Spanner at no cost for 90 days. Once you decide Spanner is the right database, you can scale as needed with no limits, and only pay for the compute capacity and storage that you use. In addition, you don’t need to over provision for your game launch, and you can use the Autoscaler to manage your Spanner utilization.

As your game grows overtime to support more players, Spanner will continue to be the database of choice for prototyping, scaling, and adjusting data models to maintain effective, low overhead engineering.

We can’t wait to see how your business uses Spanner to unlock all of your gaming potentials!

Get started with Cloud Spanner

To get started with Spanner, create a database, or try it out with a Spanner Qwiklab. You can learn more about how to develop global multiplayer games using Cloud Spanner and learn more about best practices for using Cloud Spanner as a gaming database


We would like to thank Aalok Muley and Sneha Shah for their help on this blog post.

Posted in