01 · Context
Competitions rank individuals and teams by score and submission time. Sorting directly in MySQL on a hot path can become a bottleneck as traffic grows.
Technical case study
Fast rank lookups, atomic score writes and a recovery path from durable storage.
01 · Context
Competitions rank individuals and teams by score and submission time. Sorting directly in MySQL on a hot path can become a bottleneck as traffic grows.
02 · Problem
Provide fast rank lookups, time-based tie-breaking, atomic ranking updates and a recovery path when Redis data is missing or inconsistent.
03 · Architecture
04 · Result
The solution runs in production with O(log n) rank lookups, reducing reliance on expensive MySQL sorting for the ranking hot path.
05 · Ownership
I directly implemented and operate the Redis ranking version currently running in production.
06 · Trade-off
HyperLogLog provides estimates rather than exact counts. Redis scores use doubles, so precision matters when encoding tie-breaks. MySQL remains the rebuild source.
I can walk through the technical decisions, constraints and alternatives in a conversation.
Email me