4 ms·
> A list of votes per user per page would also work. ~90% of the time that list would be empty, Not really. People tend to vote on one or two things on a page
by jedberg 10y ago
> A list of votes per user per page would also work. ~90% of the time that list would be empty,
Not really. People tend to vote on one or two things on a page. So you'll have a long list of people who voted on one or two of the 1000+ items, and now you've had to do an extra lookup.
It's a lot faster to just go straight for the votes and take advantage of the bloom filter.
- zardeh 10y agoYou work(ed) at reddit, d(o|idi)n't you?
- jedberg 10y agoWorked, yes.
- Retric 10y agoReal world data wins so if you have real data then great a write up would be cool. However, it's 100% empty the first time someone opens a link. If someone up votes there is no need to refresh, so they need to up vote and then refresh the page which I assume is less common. With lot's of pages that never get refreshed and a long tail of pages people go back to. So, my assumption is you can easily keep a vote list in memory for popular pages and everything else is basically a non issue. As to matching up votes with items, I kind of think that's for client side JavaScript in most cases.