Použijte Redis sorted set (ZSET) klíčovaný skóre: rank a top-N se stanou vestavěnými operacemi O(log N), takže nikdy neřadíte miliony řádků na požadavek. ZSET udržuje členy seřazené podle skóre automaticky; to je přesně to, co žebříček je.
Architektura
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)
