News for hackers. Stuff that matters.
Re:Ask HN: Ensuring Unseen Posts in Feed by tithe on Monday May 27, 2024 @11:08PM (#40496971)
> I do not want to show the user posts that the user has already seen.

OK, so like email with a "show only new messages" filter.

> more and more costly over time

If it's tolerable to have false positives (potentially showing a user a post that they have seen before), a Bloom filter [0] might be a good match.

If you use this structure as an index to record which posts the user has seen, then it might return a post the user has already seen before (it may answer the question "is this post ID in the set?" incorrectly), but it can for sure return a post the user has not seen before (in that it will answer "is this post ID definitely not in the set?" correctly).

[0] https://en.wikipedia.org/wiki/Bloom_filter

(Edited for clarity.)

Re:Ask HN: Ensuring Unseen Posts in Feed by centum on Monday May 27, 2024 @11:18PM (#40497012)
Thank you!