Event Sourcing the ActivityPub Server

Thanks for the elaborate reply!

Indeed, and good that you explicitely bring this up. Two things are impoortant, IMHO:

  • AP is not event-sourced (nor is it MVC or Reactive or anything), so an important part of such software would be to translate from and to ActivityPub-isms to Events: e.g. POSTing an activity in your outbox, would result in an “internal” ActivityAddedToOutbox. And a federated POST into your Inbox would result in a ActivityAddedToInbox. Those are not in your case or implementations’ domain; they are merely a mechanism to hook AP up to an event-sourced system.
  • From there, the Domain should use Domain language and not ActivityPub-isms. So, if, in e.g. your “actity-pub-enabled office collaboration suite” someone shares a document, a DocumentShared-event is emitted. One of the handlers of that event would then wrap the data and emit that as an ActivityAddedToOutbox. Reversed, a notification_service would probably listen to incoming ActivityAddedToInbox and emit PushNotificationSent or NotificationEmailSent event; or DocumentThumbnailCreated; whatever your domain needs.

@berkes what kind of app do you have in mind? And what language / frameworks do you want to use?

I’m building https://flockingbird.social. Also discussed on this forum. When I say “building”: I’m not yet writing code (unfortunately) but exploring, interviewing, wireframing and whatnot.

WRT languages and frameworks, I’ve narrowed it down to either Ruby or Rust. Because I am fluent in Ruby and because that allows me to steal/use a lot from Mastodon. Rust, because I know that too, and it would make the core (and possibly the entire software) a lot easier to distribute and run. Dropping it on a Raspberry-pi is nearly impossible with a ruby-suite (even more so if, like mastodon, you need sidekiq, redis, postgres, nodejs, elasticsearch and whatnot to run it). But dropping a binary on your Pi, and then running it, is perfectly doable. I do lean towards Ruby, with event_sourcery (framework I’m familiar with) or Sequent (framework I’ve not yet used) because of my familiarity, for the the MVC and PoC.

Go (go-fed) and .net (kroeg) is, unfortunately, no option for me, I can read and hack me some go, but not architecture a full product in it. Same with .net.

1 Like