(no title)
Squid_Tamer | 1 year ago
if random.randint(1, 100) == 1:
db.increment(row)
Then, looking at the database, you can know that the actual count is approximately 100x the number of times the row was incremented.There's an even more aggressive version that I've seen called a 'Morris Counter' which uses just a few bits to build an order-of-magnitude estimate of the number of events: https://en.wikipedia.org/wiki/Approximate_counting_algorithm
No comments yet.