
I Built a Leaderboard API Using a Skip List From Scratch (No Redis)
Every time you see a leaderboard in a game, a coding contest, or a trading app — something has to answer the question "what rank is this player?" in milliseconds, even with millions of entries. The standard answer is Redis sorted sets . But I wanted to understand why Redis sorted sets are fast — so I built the underlying data structure from scratch: a skip list . This is the story of building a full production-grade leaderboard REST API, deploying it live, and benchmarking it at 1 million players. Live demo: https://leaderboard-api-gu4v.onrender.com/docs GitHub: https://github.com/tar-ang-2004/Leaderboard-API What even is a skip list? A skip list is a probabilistic layered linked list. The bottom layer (level 0) is a complete sorted linked list of all nodes. Each higher level is a "fast lane" that skips over groups of nodes — like express lanes on a highway. level 3: HEAD ──────────────────────────────────────→ [bob:900] → None level 2: HEAD ─────────────→ [carol:650] ───────────→ [bob
Continue reading on Dev.to Python
Opens in a new tab



