Usa un sorted set (ZSET) di Redis indicizzato per punteggio: rank e top-N diventano operazioni integrate O(log N), così non ordini mai milioni di righe per richiesta. Uno ZSET mantiene i membri ordinati per punteggio automaticamente; è esattamente ciò che una leaderboard è.
Architettura
Game svc ──ZADD score──▶ Redis ZSET (sorted by score) ──ZREVRANGE 0 99──▶ Top-100 API
│
├─ ZREVRANK user ─▶ "your rank" (around-me: rank±5)
└─ AOF/RDB + async ─▶ Postgres (durable source of truth)
