How did the biggest mobile game of all time scale its Pokémon Trainer Club to support millions of users?
Couchbase and NoSQL
In a matter of days, with respect to daily active users, Pokémon GO surpassed Twitter. According to Apple 1, it set a record for the number of downloads within its first week – when it was initially launched in New Zealand, Australia, and the United States. Today, it’s been downloaded more than 500 million times.
One of the points of entry, the Pokémon Trainer Club system, augments a legacy profile management service, enabling users to create an account and sign in – not only for Pokémon GO, but for Pokémon Trading Card Game Online, Play! Pokémon, and more.
The legacy profile management service, built on top of a relational database, was capable of supporting existing users, but it could not scale to support the millions of new users expected after launching Pokémon GO. The Pokémon Company International needed a database capable of scaling.
They chose Couchbase Server Enterprise Edition.
Pokémon GO was released in a few countries at a time – from New Zealand, Australia, and the United States to Japan, Germany, Hong Kong and beyond.
This strategy enabled The Pokémon Company International to manage the growth of its infrastructure – incrementally, on demand, and as needed – ensuring that while some people had to wait to create a new account, everyone would have a chance to play.
Why Couchbase Server?
Couchbase Server 4.0 introduced N1QL, a SQL-based query language for JSON documents, easing the transition from relational databases. The Pokémon Trainer Club system was developed using N1QL, in less than three months, to minimize changes to how the data is modeled and queried in the legacy profile management service, built on top of a relational database.
By using N1QL, developers can transition from a relational database much faster, and when the time is right, optimize how the data is modeled and accessed – utilizing N1QL for queries and the key-value/sub-document APIs for reads and writes.
Couchbase Server 4.0 introduced Multi-Dimensional Scaling (MDS), enabling administrators to isolate and scale discrete services (data, query, and index). The Pokémon Trainer Club system, developed using N1QL, happens to produce a query-intensive workload. In the days following the launch of Pokémon GO, administrators were able to scale the query and index services (more than once) rather than scale the entire database – eliminating the need to rebalance or “move the data around,” a process with significant overhead.
Couchbase Server 4.5 introduced memory-optimized indexes by utilizing an in-memory skip list and persistent snapshots, removing disk IO from the critical path and reducing the latency of both index updates and index scans. The Pokémon Trainer Club system is not only query intensive (many index scans), it is write intensive (many index updates) – with everyone from the United States to Japan creating accounts.
By taking advantage of memory-optimized indexes and the read-your-own-writes (RYOW) consistency option, indexes were updated faster and queries returned consistent results.
Support and Professional Service
Couchbase was committed to the success of Pokémon GO, with support engineers available 24×7 – working during the day, late into the evening, and through the weekend to ensure a successful launch. When performance issues were identified, the support and engineering teams resolved them without delay; on one occasion delivering a maintenance patch in a matter of days. In addition, support was joined by professional services and solution engineers to help with everything from application architecture and code to deployment and scaling. It was a team effort.