Y
Hacker News
new
|
ask
|
show
|
jobs
by
lgas
3374 days 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.
2 comments
ageitgey
3374 days ago
I've seen similar approaches used to enforce rate limit checks on APIs that get lots of traffic and are distributed amongst many different servers.
link
kartiksura
3374 days ago
This 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.
link