Warp factor 5, Mr. Sulu

Warp factor 5, Mr. Sulu

Things are speeding up around here

It's said that there are only 2 hard problems in computer science: Cache busting, naming things, and off-by-one errors. But if we can add a 5th, database architecture should probably be on the list.

Last week, we shared the final UI structure for the ActivityPub reading client inside Ghost Admin, which has come a very long way since our early prototypes. We also shared an invitation from the Flipboard team, for anyone who's interested, to attend the Fediverse House meetup at SXSW next weekend.

What's new with ActivityPub?

The best kind of performance improvement is the one that surprises you. The kind where you flip a switch, look at the numbers, and go, "Oh.." — followed by a long moment of disbelief, intertwined with cautious optimism.

That finally happened this week.

We've been working on a major update to the ActivityPub database for a while now, as anyone who has been subscribed to our updates for more than a few weeks will already be well aware. As with all database-related work, it has been a deep, unavoidable architectural rework. But the payoff, in performance?

See for yourself, in a before-vs-after where the "after" can't come soon enough.

0:00
/0:41

Having finally shipped our database upgrade for the main ActivityPub timelines in Ghost, the performance boost is even better than we'd hoped for:

A 100x speed improvement.

In our logs, that looks like our average request time dropping from 5+ seconds, to ~50ms:

This work has been the main blocker to opening ActivityPub in Ghost up for a public beta with many more users, so this is a big milestone for our little team!

There are still a few places where we're using the old database architecture that remain slow. We're not out of the woods just yet. Within the next couple of weeks, though, the beta will be open to everyone on Ghost(Pro) to try out.

For those of you following along and waiting patiently, your patience is about to pay off!

What about self-hosting?

Several people have asked about using ActivityPub if you're hosting Ghost elsewhere. Some quick notes about that:

Importantly, Ghost's ActivityPub service is already out in the wild, open source, and released under the MIT license. We build in public, and all our work is up on GitHub for anyone to download, fork, run or deploy if they want to.

GitHub - TryGhost/ActivityPub: A full-featured ActivityPub server for networked publishing with Ghost
A full-featured ActivityPub server for networked publishing with Ghost - TryGhost/ActivityPub

What's missing right now, mainly, is documentation. You could already self-host ActivityPub if you really wanted to, but there's a lot you'd need to figure out to get it running properly.

So the question is less "when will it be possible" and more "when will it be easy"?

At the moment we're moving quickly and making many breaking changes each week which aren't backwards compatible (like switching to a new DB) – so the app isn't stable. Even if we did document everything, if you self-hosted then it would just break constantly — so it doesn't make much sense for us to try to document and promote self-hosting, because it won't be a good experience for anyone.

Right now we're prioritising developing the app and building features, deployed in a single location, so we can make progress. Once the app is stable, then we'll start documenting (and optimizing) the process of deploying it and hosting it elsewhere.

We're hoping to get to that work some time this summer, and we'll share details of that here, as we go. Our first priority is just getting ActivityPub working and stable with a base feature set.