Our Mastodon Clone
We rebuilt the Mastodon backend from scratch and made it able to handle Twitter-scale (500M users, 20M writes/second, unbalanced social graph, etc.). Our implementation is only 10k lines of code and is also significantly simpler than the existing Mastodon implementation. Our instance ran from August 15th, 2023 to August 24th, 2023 at mastodon.redplanetlabs.com. The instance ran with 100M bots posting 3,500 times per second at 403 average fanout to demonstrate its scale.
Code
Twitter's original consumer product is comparable to Mastodon today. It had a similar feature set and similar technical challenges. To reach scale, Twitter had to write about 1M lines of code, much of which was a lot of specialized infrastructure built from scratch.
Total engineering hours
Besides writing product code, Twitter spent a significant amount of time on other tasks involved in the productionization of their product. This included deployment, monitoring, and other operational work, all of which significantly added to the total hours spent getting Twitter to production. Because Rama simplifies backend development so much, we saw major cost savings not just in coding the product but in these other areas as well.
Performance
Rama's integrated nature enables our Mastodon instance to have performance even better than Twitter. Below are charts demonstrating its performance on three of the most important metrics for the product: scalability, the time from posting a status to it being available on follower timelines, and the time to render a home timeline.
MASTODON CLONE OPEN-SOURCE
Go to GitHub repositoryARTICLE
How we reduced the cost of building Twitter at Twitter-scale by 100x
Twitter's original consumer product cost 1M lines of code and 200 person-years to build. Read about how we rewrote Mastodon, a similar product to Twitter, to be fully scalable in only 10k lines of code and nine person-months of time.
Read More