I’ve been running Mastodon on Heroku for about a week now, and it’s been a blast! Heroku is really convenient, but it’s also expensive. So I’m looking at an alternative hosting plan. Because I’m learning as I go along, I wanted to write a post about my migration plan, to hopefully get feedback from people who’ve done this kind of thing before.
Let’s start with the current infrastructure: two Heroku apps, one for streaming and one for everything else. Estimated costs are ~$150/month. I don’t know what to expect from AWS, but from my experience I’m guess that it’ll be a lot less than I’m paying now. Additionally, as the community scales up, I’ll be able to more easily scale my instance.
I considered Digital Ocean, since it would probably be even cheaper, but I would have to do a lot more to administer Postgres and Redis instances, which seems boring and tedious. I’d rather use RDS and ElastiCache respectively for the convenience.
What I’m thinking of is an AWS infrastructure that replaces Heroku Add-Ons for AWS services. I figure if I’m getting into AWS hosting I may as well dive right in, to get the most advantage from fully participating in their ecosystem.
(Note that both infrastructures use S3 for static asset hosting, which is not shown.)
So the big question is, how do I go from one to the other? Well here’s my plan:
Aaaaaaand I think that’s it. Hopefully minimal downtime.
This is a learning experience for me. It seemed really scary at first but writing it out made things make more sense.
I reckon this will take a solid weekend of work, but I’m happy to do it because a) I really like Mastodon and contributing to a distributed community is rewarding, and b) I’ll learn a tonne, which is its own reward.
And again, any advice you have would be welcome. Toot me or send me an email if you have any advice, and I’ll amend my post.