A mobile game needs a live ranking of millions of players that updates as scores change. Players must see their rank with low-millisecond latency, and the ranking must stay correct after each atomic score update. Which design is most appropriate?
Show answer and explanation
Answer: C
Redis sorted sets keep members ordered by score in memory, so score increments are atomic and rank or range lookups return in very low latency. Memorystore for Redis provides this as a managed service. It is the standard fit for leaderboards with high update rates and millisecond reads.
Why the other options are wrong
- A. BigQuery is an analytical engine with query latency measured in seconds, not an update-heavy serving store. Refreshing views frequently still does not deliver millisecond rank lookups for live players.
- B. Cloud SQL can index scores, but ranking millions of rows under constant updates would strain write throughput and rank queries. It does not match the millisecond latency the leaderboard needs.
- D. Spanner is a strongly consistent relational database that can scale, but it is more costly and heavier than needed for a leaderboard. It lacks the in-memory ordered structure that makes rank reads so fast.