Product · high throughput
Contest Leaderboard
Realtime tournament leaderboards on sharded Redis sorted sets. Built for millions of users. Now with a live frontend.
P95
50ms
Load test
3k RPS
Problem
JAR Premier League needed a leaderboard that stayed correct under write-heavy contest traffic, with fair tie-breaks and cheap top-N reads.
What I built
- 10-way Redis shard by userId, ZSET scores with timestamp tie-break
- Hash of original points + cross-shard rank merge
- Locust load test: P95 50ms at 3000 RPS
- React frontend: contest switcher, live top-N, rank lookup, score submit
Architecture
Spring Boot → CacheService (RedisTemplate) → Leaderboard:{contest}:shard:{0-9} ZSETs + UserPoints hash. Rank = 1 + count of strictly higher scores across shards.JavaSpring BootRedisReact