EVENTGet 50% off your ticket to MongoDB.local NYC on May 2. Use code Web50! Learn more >

Cultivating immortality: Mobile game scales to 10 million players and doubles operational efficiency with MongoDB and Alibaba

INDUSTRY

Gaming

USE CASE

Gaming

CUSTOMER SINCE

2021
INTRODUCTION

Gaming industry seeing massive growth and diversification

The global gaming industry has grown massively in recent years and much of that growth has come from China, with its large population and ecosystem of talented developers. The increase in popularity overall has also led to a wide variety of themes, game styles and devices to meet different preferences. One of the leading game developers capitalizing on this growth and variety is G-bits, a publicly listed Xiamen based development studio. Since its establishment, G-bits has been deeply focused on continuously investing in research and development, with strong independent capabilities. This focus has led to a string of popular games that have reached more than 45 million gamers. The games include titles such as Ask Tao (Mobile Version), Dissimilated Land, Wonderful Fighter and Ask Tao, G-bits most popular game to date.

As the variety of playing styles and number of players has increased, so have the challenges for the company's technology stack, particularly when it comes to operating the games efficiently at scale and providing the richest possible functionality. The studio's latest game is Yi Nian Xiao Yao, a beautifully rendered mobile game that uses traditional Chinese ink-and-wash style imagery and classic themes, such as cultivating immortality (a concept of using certain martial and mystical arts to extend a character's life). Shen Yuqing, Head of the Technology Center at G-bits and the Producer of Yi Nian Xiao Yao, along with the game’s development team, hopes to make the game a refreshing and unique mobile game that can be played quickly and easily, and reach a large audience. To do that he and his team had to overcome a number of hurdles, most fundamental of which was finding a better data infrastructure to power their game in the hope of cultivating another hit.

Image by the courtesy of G-Bits, and is exclusive for ApsaraDB for MongoDB case use All rights reserved

Image by the courtesy of G-Bits, and is exclusive for ApsaraDB for MongoDB case use
All rights reserved

THE CHALLENGE

High expectations for user experience and improved flexibility lead to a new data layer strategy

The Yi Nian Xiao Yao development team wanted to introduce a number of new elements into the game but with high expectations from the studio and a short development window, pressure was high. The team used the “short steps, fast running” style of development, which is a local way of describing an agile development methodology designed to allow for continuous development and integration that rolls seamlessly into the game's launch. The underlying database software and operations are the foundation for good player experience and for the experience of the developers running the game.

For previous games G-bits had used an on-premise relational database, MySQL, to build and run the games but the team felt the new game would challenge the relational model. There were three main reasons for this:

  • The first reason is to ensure that the game experience of players is smooth and uninterrupted, which requires the platform to have seamless processing capabilities for game data. Even if there is a failure in the back end, the player experience should not be impacted. Therefore, the speed of failover and recovery should be rapid, the service response time needs to beat the sub-microsecond level, to ensure the positive experience for players.

  • The second reason is that Shen Yuqing and his team needed to be able to easily handle the data generated by various operation and maintenance processes and support the release of new games in a timely manner. The potential audience for Yi Nian Xiao Yao is huge. But, during the various stages of functional testing, performance testing, game release, and online service operation, the requirements for database resources vary widely, so there was also a need to be able to efficiently scale up and down. And finally, if a single machine is deployed with multiple database instances, the contention over CPU and IO resources could easily cause performance issues.

  • The third point is around flexibility. The character attributes in Yi Nian Xiao Yao game often change, with new elements such as weapons and props being introduced, which bring dynamic changes in game logic and data structures, and require high-level flexibility in the database. The relational data model also makes it much harder to add new data types.

While MySQL could meet the basic performance and functional requirements of some of its large mobile game projects, when it is necessary to scale out, scale in or make adjustments in the game, using a relational database can create significant challenges. The teams have to manually shard the RDBMS which is tedious, time consuming and risks degrading user experience.

THE SOLUTION

MongoDB and Alibaba combine to deliver gratifying flexibility and powerful performance

For a project a number of years ago Shen Yuqing had tried ApsaraDB for MongoDB. As he describes it, although he only tested the features he was deeply impressed by its ease-of-use and flexibility.

ApsaraDB for MongoDB is the fully managed cloud database service run by Alibaba and certified by MongoDB Inc, the company that builds and maintains the MongoDB software. Alibaba is one of a select few of premier partners in the region offering a MongoDB-as-a-Service which allows companies the freedom to innovate in one of the largest global markets and in close proximity to their largest customer base. With the launch of the Yi Nian Xiao Yao, Shen and his team needed to find a database with higher flexibility and performance. Changing database software is a major undertaking, but the result has so far exceeded their expectations.

After investigating these options, the team quickly came back to ApsaraDB for MongoDB.

Shen explained that the data of Yi Nian Xiao Yao is stored in a JSON document so it is well suited to the MongoDB document database. The underlying document model allows developers to easily make changes and add new features.

At the level of ensuring good quality user experience, ApsaraDB for MongoDB's also delivers. As a responsive cloud service it can expand and shrink capacity to meet database resource requirements in various scenarios (scaling up when user numbers are high, and scaling back down when they are not).

Moreover, a flexible model can store character data in a single collection, with low adjustment costs. The data is stored in the same availability zone which helps deliver an average query response time of 400 microseconds for local players. The service also supports high availability, and if coupled with retry and caching, it can ensure stable and uninterrupted services for players, even if there were to be a minor outage.

In addition, in response to the challenges from the operational side of launching and running a game, ApsaraDB for MongoDB has out-of-the-box features that can support the rapid release of new games. For instance, it can greatly improve the data backup and recovery speed through Alibaba's cloud backup and multi-threaded recovery of oplog. Furthermore, ApsaraDB for MongoDB supports workload isolation, allowing the team to distribute different workloads across the nodes in a deployment to eliminate the possibility of resource contention which can negatively impact gameplay.

THE RESULTS

Going global

Since its release, in Feb 2021 the Yi Nian Xiao Yao game has attracted tens of millions of players and at any one time can support hundreds of thousands of people playing concurrently online. This has far exceeded the initial expectations of the development team. By using the AsparaDB for MongoDB service and features such as multi-threaded incremental recovery of oplog, the recovery time if there is an outage has improved by 50 times.

In addition, Alibaba Cloud ApsaraDB for MongoDB not only meets high-performance requirements of "Yi Nian Xiao Yao", but also reduces the investment of G-bits in its IT operations.

Out-of-the-box features like monitoring, visualizations and backups have all helped at least double operational efficiency. Now Shen Yuqing and his team can focus more on adding new features to drive user engagement. The freed up time has also allowed them to continue work on another bold endeavor: an attempt to build their own game programing language--Game Script (GS), which is similar to Python and JavaScript, and with which they are utilizing to build a game server framework. It's not hard to guess which database service he'll use.

Not only that, with the upgrade of Alibaba Cloud ApsaraDB to MongoDB 5.0, Shen and his team are expecting to develop more mobile games with the help of the new features such as Native Time Series collections. Moreover, with the successful experience in China, they are also planning to work with Alibaba Cloud ApsaraDB for MongoDB to help Yi Nian Xiao Yao to go global, enabling overseas players to have their own chance at cultivating immortality.

"Data is our life, which is no exaggeration. The powerful performance and flexible expansion capability of Alibaba Cloud ApsaraDB for MongoDB is helping us improve the developing and operating efficiency of 'Yi Nian Xiao Yao', as well as delivering players an uninterrupted experience of 'immortal cultivation'. I believe this is only a small part of the power of the database service. Next, as we begin to develop more game projects and plan to implement the overseas promotion strategy, we are looking forward to deeply tapping the greater potential of Alibaba Cloud ApsaraDB for MongoDB.”

Shen Yuqing, Head of the Technology Center at G-bits and Producer of "Yi Nian Xiao Yao"

Get Started with ApsaraDB for MongoDB

MongoDB on Alibaba Cloud’s platform has access to the latest MongoDB features and capabilities, with comprehensive support from Alibaba Cloud and MongoDB.