Hacker News new | ask | show | jobs
by serverholic 1295 days ago
I’ve heard ActivityPub has mixed reviews. Perhaps someone here with a little more expertise can answer this question.

Does ActivityPub have a batching mechanism?

Imagine you are on server A and you have 3000 followers on server B. If you create a post do 3000 messages get sent to server B? Or just one?

2 comments

> 7.1.3 Shared Inbox Delivery

> For servers hosting many actors, delivery to all followers can result in an overwhelming number of messages sent. Some servers would also like to display a list of all messages posted publicly to the "known network". Thus ActivityPub provides an optional mechanism for serving these two use cases.

From https://www.w3.org/TR/activitypub/#outbox-delivery

You don't necessarily have a sharedInbox though, I think?
Servers are not required to provide a shared inbox, but if they want to enable batching behavior they can. Not sure if that's what your asking?
AFAIUI yes, you will probably get 3000 messages sent because each follower has their own inbox. There is a potential for batching though - "a server MAY reduce the number of receiving actors delivered to by identifying all followers which share the same sharedInbox who would otherwise be individual recipients and instead deliver objects to said sharedInbox" - if a bunch of the 3000 followers have the same sharedInbox (which presumably the receiving server has somehow magicked up?[1]), then your server can do a bulk delivery to that for those followers.

[1] I guess you might make them for specific celebrities if your server has a high density of followers? grepping the Pleroma source doesn't seem to throw up any obvious "automatically make them" logic.

Generally, all followers on a single server share the same sharedInbox. To a first approximation, that's what "server" means on ActivityPub—sharing a "batch" inbox you can deliver to.
> Generally, all followers on a single server share the same sharedInbox.

You mean that all followers of Celebrity X on instance Y will have a sharedInbox because they're a follower of Celebrity X? Apologies, I've only lightly read the spec and haven't really seen anything like this in there.

No, sorry, what I mean is that all users on mastodon.social have a unique private inbox and then a "sharedInbox" value of "https://mastodon.social/inbox". Almost all deliveries (with appropriate "to" and "cc" targeting values that the receiving server can appropriately deliver to, i.e. individual actors or the special "followers" group for an actors) can be sent to the sharedInbox in bulk, but for private groups and some other special cases you may want to use direct delivery.