3 ms·
For scaling view counters on the pages of popular videos Youtube increments the counter by N views with 1/N probability for each actual view. Or so I've been t
by lgas 10y ago
For scaling view counters on the pages of popular videos Youtube increments the counter by N views with 1/N probability for each actual view. Or so I've been told.
- ageitgey 10y agoI've seen similar approaches used to enforce rate limit checks on APIs that get lots of traffic and are distributed amongst many different servers.
- kartiksura 10y agoThis is really neat. You need to take only 1/N of the locks. Maybe the N can be started small and changed gradually as the views increase.