Company
Date Published
Author
Redis
Word count
1445
Language
English
Hacker News points
None

Summary

Redis is being used to power an action platformer game called Super Redis Brothers, which features a character named Redisman who collects coins and uses them to gain power-ups. The coin count of the character is stored in a Sorted Set data structure, allowing for efficient retrieval and update of scores. The use of Sorted Sets enables the implementation of leaderboards and player-matching systems, as well as tracking of individual players' scores. To manage potential issues with hot keys, strategies such as using multiple clusters or implementing a round-robin write approach can be employed. Redisman's power-ups, such as freezing enemies or reducing coin count to zero, are implemented using commands like ZINCRBY and ZADD, which allow for atomic updates of the score. The use of Lua scripts enables simple and efficient management of complex logic, while Sorted Sets provide a near-perfect data structure for leaderboards.