I was curious about how Mastodon is actually implemented. A high-level overview:

Looking at the code, it's definitely an interesting look into the early 2010s style of development. There's nothing wrong with it, and in fact, it's extremely effective at shipping an actual product (because the tech stack rarely is more important than distribution).

But it got me thinking about how incompatible the architecture already is with the shift to cloud and serverless. As a result, Mastodon is a bit tough to self-host. It would be hard to take advantage of the latest trends in infrastructure:

This isn't meant to be a criticism of Mastodon – software that ships are better than software that doesn't. And Mastodon was originally developed in 2016. Many of the technologies I listed will likely be out of date in the next few years. It's more an observation of how quickly things change, even infrastructure. And how there are always opportunities to rewrite and optimize old tech with new infra.


Another example of this is Ghost, the blog software that I currently use to send out the newsletter. It's a heavy-weight process to run yourself – another Express monolith. I've already migrated the front end to NextJS; all that is left is to send the mail out with AWS SES (eventually!). There's probably some room in the market for a minimal blog/newsletter that is completely serverless and uses a simple SQLite backend (Ghost stopped supporting SQLite in production, a backward step, in my opinion).