this post was submitted on 02 Jul 2023
44 points (97.8% liked)

Selfhosted

40731 readers
336 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] savjee 6 points 2 years ago (1 children)

Amazing blog post! Been reading the ActivityPub spec and found it rather lacking. It’s only when you add WebFinger and signed messages that things start to make sense.

[–] savjee 5 points 2 years ago* (last edited 2 years ago) (2 children)

And a followup question: wouldn’t it be more efficient for big instances to use WebSockets to federate? Making a HTTP request for every action your users take seems unnecessarily wasteful.

[–] [email protected] 3 points 2 years ago

Yeah it’s definitely very busy in terms of the amount of requests that’s get made. I’m not handling a bunch of them that I don’t need but there’s shitloads all the time.

[–] [email protected] 3 points 2 years ago (1 children)

I think that would only work when the number of instances is small. Two solutions to this might be:

  • have instances act like relays where the home instance of a community notifies 10 instances and then each of those instances notifies 10 instances, etc.
  • batch updates on a timer such that once a minute all posts, comments, boosts, etc within a minutes are buffered and sent together.
[–] savjee 1 points 2 years ago

I looked at how many WebSocket connections a single server could keep open, and it seems quite high: https://unetworkingab.medium.com/millions-of-active-websockets-with-node-js-7dc575746a01

That being said, I do agree with you that it's inefficient to open a connection to every other instance.

About your proposals:

  • I don't think your first solution is feasible. How would an instance know which other 10 instances to notify?
  • I do like your idea of batching operations together! Would definitely cut back on the amount of HTTP calls and signature validations. Perhaps this can even be extended further: right now every user interaction is signed before its been sent to other instances. Would be interesting if the instance itself also has a public/private key and that it can sign a whole batch at once (rather then signing every single user interaction).