How Podium Forces Redis Cluster to Handle Leaderboard Writes Atomically
Redis Cluster distributes keys across 16,384 hash slots by default, which can scatter related leaderboard data across different nodes and break atomic Lua script execution. Podium, an open-source Redis-backed leaderboard engine for games, solves this by using Redis Cluster hash tags to ensure all keys for a single leaderboard land on the same node. The system URL-safe-base64-encodes each leaderboard ID and embeds it as a hash tag in every related key, including score indexes, member mappings, and tie-break sequences. This co-location allows a single Lua script to atomically update all related state — allocating tie-break sequences, writing indexes, and returning a final rank — without risking a CROSSSLOT error. The trade-off is that an individual leaderboard cannot itself be sharded across multiple nodes, meaning Redis Cluster provides dataset distribution but not intra-leaderboard horizontal scaling.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in