← Back to context

Comment by voidUpdate

1 month 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?

In the ATProto architecture, this function is handled by the AppView, which monitors the full network and produces the corresponding aggregates.

  • There'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/

  • Yes. I describe this in this part of the article: 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) that do the plumbing work and let you backfill automatically.