Wouldn't it had been easier to simply increment a counter for each visit and then set a short lived cookie in the browser for that post? And put the spam detection system before the counter increment
View Counting at Reddit
51–60 of 121 posts
Re: View Counting at Reddit
#52So how do they determine whether a user has viewed a post already? I would think that unique counting is accomplished using the hyperloglog counter, but the article says that this decision is made by the Nazar system, which doesn't use the hyperloglog counter in Redis.
Re: View Counting at Reddit
#53Re: View Counting at Reddit
#54So how do they determine whether a user has viewed a post already? I would think that unique counting is accomplished using the hyperloglog counter, but the article says that this decision is made by the Nazar system, which doesn't use the hyperloglog counter in Redis.
Re: View Counting at Reddit
#55Earlier quoted context omitted.
You are correct, but HyperLogLog has many buckets counting the longest run of zeros in order to avoid the problem of outliers. I recently studied these probabilistic algorithms and did a notebook with code and plots to show their performance: https://github.com/lucasschmidtc/Probabilistic-Algorithms/bl...
Thanks for sharing that! Just skimmed through it and seems pretty interesting. I'll read it more in depth later.
Re: View Counting at Reddit
#56Earlier quoted context omitted.
How about, here and on reddit, being able to mark threads you're interested in, and having a page where you can see those sorted by last reply. On HN, make that page refresh every 15 or 60 minutes or whatever. Heck, once every 24 hours would be enough... sometimes I just want to talk about the things that interest me, with the people that are interested in them. I would love to be able to think on something for a few…
Actually, reddit has that. You can save threads or comments, and sort by latest.
Re: View Counting at Reddit
#57Earlier quoted context omitted.
How do you concurrently update a counter?
Redis writes are atomic - you just use the increment function
Re: View Counting at Reddit
#58Earlier quoted context omitted.
Redis writes are atomic - you just use the increment function
Writes are atomic in redis because redis is single threaded. So you are bounded by how fast redis can write. If you try to write any faster then redis can handle you'll get queueing or errors.
Re: View Counting at Reddit
#59I love the article on hyperloglog! It is really quite good to read even if you're not interested in algorithms. I always liked number theory and I think that it's very interesting that you can guess how many uniques there are by counting how long your longest run of zeroes in a hash is. I suppose this could be broken by injecting in a unique visitor id that would hash to something with an absurd amount of zeroes? Tha…
You are correct, but HyperLogLog has many buckets counting the longest run of zeros in order to avoid the problem of outliers. I recently studied these probabilistic algorithms and did a notebook with code and plots to show their performance: https://github.com/lucasschmidtc/Probabilistic-Algorithms/bl...