Rankings that are always current
Build leaderboards and rankings on KiviDB sorted sets: update a score, read the top of the table, or find one player's rank, each in a single command.
A sorted set keeps its members in order as their scores change. Updating a score, reading the top ten and finding one player's rank are each a single command.
Where KiviDB sits
Scores (from your game or app) → KiviDB (a sorted set, ordered as it is written) → The board (top ten, or one player's rank)
One sorted set per board
- Update in place ZADD sets a score and ZINCRBY adds to one. The order is maintained as you write.
- Read any slice The top of the table, a page in the middle, or the players around one rank, with ZRANGE.
- Combine boards ZUNION and ZINTER merge daily boards into a weekly one, or keep only players who appear in both.
What KiviDB Cloud adds
- Replicas and failover On the Pro plan a replica takes over when the primary is lost, and the hostname your application uses stays the same.
- Durability An append-only log on paid plans, snapshots on demand, and scheduled snapshots you can switch on.
- Access control A firewall per database, closed until you open it, database users with their own permissions, and private connectivity.
Other use cases
- Caching: Keep hot data in memory in front of a slower store.
- Session store: Sessions that every application server can read.
- Rate limiting: Count and cap requests per user, key or address.
Rank anything as it changes
Create a free database and try the three commands above.