Exploring leaderboards with competition ranking
Blog post from Momento
Leaderboards, commonly used to rank players in various contexts, can be more complex than they initially appear, particularly when moving beyond simple ordinal rankings to competition rankings where players with the same score receive the same rank. The process involves using sorted sets to determine rankings and requires recalculating rankings periodically to accommodate changes in scores, as a single score change can affect the ranks of many players. Implementing competition ranking can be challenging due to the need for eventual consistency, but it can be managed with tools like Momento Cache, which supports storing player scores and retrieving rankings efficiently. The solution involves maintaining a sorted set for live scores and periodically updating a separate set for competition rankings, accepting some staleness in the data to ensure scalability. The author plans to further explore the practical implementation of these techniques and invites feedback and interaction from the community.