Загрузка...

How a game shows a live leaderboard for 10M players | system design

You don't re-sort 10 million scores. You keep them in a structure built for ranking.

Use a sorted set like in Redis: it gives top-N and a player's rank in log time, updated in place per score, with the top-100 cached.

A live top-100 plus 'your rank' across 10 million players means constant updates and constant sorting, which a normal table can't do quickly.

How it stays live:
- Use a sorted set, like in Redis, which gives top-N and a player's rank in log time
- Update a single player's score in place, with no full re-sort
- Cache the top-100, since it changes less often than individual ranks deeper down

The catch: one global sorted set becomes a hot key under millions of updates. You shard it by score range or region and merge, which makes exact global rank harder to compute.

One global leaderboard, or sharded with approximate global ranks?

#systemdesign #techinterview #softwareengineering #codinginterview #faang #interviewprep #leaderboard #redis #gaming #ranking #backend

Видео How a game shows a live leaderboard for 10M players | system design канала The System Round
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять