3 ms·
How does this system determine the amount of likes a post has? Since there is no back reference on a post to people who have liked it, don't you have to iterate
by voidUpdate 8mo ago
How does this system determine the amount of likes a post has? Since there is no back reference on a post to people who have liked it, don't you have to iterate over every single person, iterate over their likes, to see if one of them is the post you are viewing, and add all them up?
- galactus 8mo agoIn the ATProto architecture, this function is handled by the AppView, which monitors the full network and produces the corresponding aggregates.
- danabramov 8mo agoYes. I describe this in this part of the article: https://overreacted.io/a-social-filesystem/#:~:text=One%20challenge%20with,like%20vote_count. https://overreacted.io/a-social-filesystem/#:~:text=One%20ch... It's basically event sourcing. You listen to the data you care about from the network and update the local index (DB). There are also tools like Tap (https://docs.bsky.app/blog/introducing-tap https://docs.bsky.app/blog/introducing-tap) that do the plumbing work and let you backfill automatically.
- voidUpdate 8mo agoAh, I'm sorry, I somehow skipped over that bit entirely. Need more coffee, I think
- extraduder_ire 8mo agoThere's also software called Constellation[0] from microcosm that exclusively collects "backlinks", which are items which link to a certain thing. e.g. follow records for an account, reposts/replies/likes on a post. If you click on the Backlinks tab when examining something on pdsls.dev you can see a list of them. It can be self hosted and is much lighter than running a full appview. The author has a public endpoint for it that's keeping up with the whole network running on a single raspberry pi on his home network. 0: https://www.microcosm.blue/ https://www.microcosm.blue/