advancedTop 30 Scenario-Based Questions
Design a real-time leaderboard for a mobile game with 10 million players.
Redis Sorted Set is purpose-built: 1) Update score: ZADD game:global:scores {newScore} '{playerId}'. For increment: ZINCRBY game:global:scores {amount} '{playerId}'. 2) Get top 100: ZREVRANGE game:global:scores 0 99 WITHSCORES. 3) Get player rank: ZREVRANK game:global:scores '{playerId}' (0-based; add 1). 4) Get player score: ZSCORE game:global:scores '{playerId}'. 5) Weekly leaderboard: use separ
This is a Pro chapter
Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.
Design a real-time leaderboard for a mobile game with 10 million players.