Glance Saket Agarwal Oct 18, 2023

Scaling Glance Game Centre to Support 100 Million Daily Active Users

Article Summary

Glance Game Centre serves millions of daily users playing HTML5 games on their lock screens. Their leaderboard system hit a wall with a single-node MongoDB struggling under 1000 QPS.

The Glance engineering team needed to scale their tournament leaderboard infrastructure 100x to support concurrent tournaments across hundreds of games. They documented their migration from self-hosted MongoDB to Azure Cosmos DB with zero downtime.

Key Takeaways

Critical Insight

Glance scaled their gaming leaderboard to handle 100M daily active users by migrating to Cosmos DB without a single second of downtime.

The team hints at further innovations to reduce latency and cost, but those optimizations are saved for their next post.

About This Article

Problem

Glance's leaderboard had 10M+ documents spread across 3 MongoDB collections. With 1000 QPS hitting the system from reads and writes combined, they couldn't run multiple tournaments at the same time without running into limits.

Solution

Saket Agarwal's team switched to Azure Cosmos DB's MongoDB API v4. They created a synthetic partition key using tournamentId_userId and set up three optimized indexes, including single-key and compound options. This spread the load evenly across logical partitions.

Impact

The move let Glance scale the leaderboard horizontally without any downtime. They can now add more Request Units as they grow beyond their current 100M daily active users.