#6346·lemmy

Batching for vote activities

Author: NutomicCreated Feb 17, 2026Updated Sep 24, 2026
Labelsenhancementarea: federationarea: performance

Piefed implemented a way to reduce the amount of HTTP requests for sending votes over federation, by batching multiple votes in a single activity. See FEP-4248 for details.

The implementation is not so complicated, change Announce.object to Vec and add #[serde(deserialize_with = "deserialize_one_or_many")]. That is already enough to handle incoming batched vote activities from Piefed. We also need to specify that batching is supported, probably via Nodeinfo metadata.

To batch outgoing activities, we need to collect these actions in a buffer and start sending at regular intervals. Piefed uses a one minute interval. The tricky part here is to handle crashes gracefully. The best option may be a new db column like_federated: bool, and a scheduled task which reads and sends the unfederated likes every minute.

Edit: Official FEP link. Also Piefed advertises capabilities via Nodeinfo, we will also need to add this to Lemmy:

json
  "metadata": {
    "capabilities": [
      "fep-1b12",
      "fep-1a11",
      "fep-7888",
      "fep-c0e0",
      "fep-5feb"
    ]
  },