Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Creating Gaming Leaderboards
Using Redis
Ronny López
Technical Lead Backend
Ronny.lopez@socialpoint.es
Leaderboards
• Effective way to show where a user stands within a gamified
system
• Absolute leaderboards – incentivize
• ...
3
4
5
Requirements
•
•
•
•
•
•
•

Add member
Remove member
Update member score
Find member score
Find member rank
Associate data...
Architecture
 Scalable to serve several million active users
 Performance is a must

7
Implementation
•
•
•
•
•
•

Redis data structure server
Sorted set data structure
Different sorted sets for different kind...
Challenges
• Horizontal scaling
• It is not possible to shard a dataset with a single huge key like a
very big sorted set
...
Summary
• Redis is the right tool for the job, but datasets can not be bigger
than memory
• Exceptional performance (more ...
Upcoming SlideShare
Loading in …5
×

Creating Game Leaderboards with Redis

13,619 views

Published on

The leaderboard adds a whole new dimension to your video game. It's a means of building rivalry between players and deepening their engagement with the game. But, like most things in gaming, building a leaderboard comes with its own technical challenges.

Published in: Technology

Creating Game Leaderboards with Redis

  1. 1. Creating Gaming Leaderboards Using Redis Ronny López Technical Lead Backend Ronny.lopez@socialpoint.es
  2. 2. Leaderboards • Effective way to show where a user stands within a gamified system • Absolute leaderboards – incentivize • Relative leaderboards – avoid disengagement of players at lower end of rankings • Several type of rankings (weekly, monthly, friends, …) 2
  3. 3. 3
  4. 4. 4
  5. 5. 5
  6. 6. Requirements • • • • • • • Add member Remove member Update member score Find member score Find member rank Associate data to members (Name, Alliance, etc…) Get slices of the ranking (for pagination) 6
  7. 7. Architecture  Scalable to serve several million active users  Performance is a must 7
  8. 8. Implementation • • • • • • Redis data structure server Sorted set data structure Different sorted sets for different kinds of rankings Redis hash data structure for member associated data Lua scripting for aggregating in-memory data (Sorted) Sets operations (union, intersection, etc…) 8
  9. 9. Challenges • Horizontal scaling • It is not possible to shard a dataset with a single huge key like a very big sorted set • Two-phase commits if you want to execute a transaction among different data stores 9
  10. 10. Summary • Redis is the right tool for the job, but datasets can not be bigger than memory • Exceptional performance (more than 8K leaderboard ops per second in a single instance) • Easy to use and understand technology • Mature and open source 10

×