Visualizing Mastodon’s Data Schema with Liam ERD
Text by Takafumi Endo
Published
Mastodon stands as a prime example of how a decentralized social network can thrive under open-source principles. Rather than replicating the centralized models seen on major platforms, it empowers individuals to create their own servers—known as “instances”—all while remaining interconnected. This design ensures that each community can maintain its autonomy while still sharing a broader network.
The Mastodon Annual Report 2023, the latest annual report available at the time of writing, offers concrete data to support this growth. Over the past year, registered accounts rose by 38.5% to reach 8.8 million, and monthly active users totaled 1.56 million across 9,800 servers. Donations increased by 65%, thanks in part to community funding drives and a notable $100,000 contribution from Sujitech. On the product side, Mastodon introduced improvements in user onboarding, enhanced search functionality, and new mobile app features—leading to 1.87 million combined downloads on iOS and Android in 2023.
A key attraction of Mastodon is its “federated” design, which embraces a wide variety of communities. Each instance sets its own rules and fosters a distinct culture, giving users the freedom to join whichever environment resonates most with them—rather than adapting to a one-size-fits-all platform. In an era dominated by large tech companies, Mastodon’s personalized approach feels refreshingly different. Server administrators actively shape their local environment, and users themselves decide how they want to engage with others. This dynamic reflects the best qualities of the open-source mindset, where technology evolves through collaboration and direct user influence.
Looking ahead, Mastodon offers valuable insights into the future of social media. Its example shows how technological innovation and collective energy can come together to form a platform that is both cutting-edge and inclusive. Instead of entrusting everything to a single tech giant, people can build and sustain their own communities—and in doing so, shape the online spaces that matter to them most.
Demystifying Mastodon’s Data with Liam ERD
Our main goal with Liam ERD is to make complex databases easier to understand. Relying solely on SQL files and text-based documentation can quickly become confusing, so Liam ERD automatically generates visual diagrams of tables and relationships. This means you don’t have to sift through code line by line to see how everything fits together.
Using Liam ERD with Mastodon’s extensive database has been particularly rewarding. Mastodon has about a hundred tables that handle everything from user profiles to timelines and notifications. Rather than feeling overwhelmed, you can filter out irrelevant details and focus on what matters most—giving you a clearer picture of how Mastodon’s features interconnect.
We also made Liam ERD interactive. Instead of a static diagram, you can zoom, pan, and click on elements for more information. This hands-on approach turns the schema into a dynamic learning tool, letting you explore Mastodon’s architecture at your own pace.
While Mastodon’s schema is large, it is built on solid engineering practices: normalization, well-chosen data types, and foreign keys that maintain relational integrity. Seeing these best practices in action—especially at the scale of millions of users—can be far more illuminating than simply reading about them in a textbook.
Because Mastodon is open source, you can watch its schema evolve as new features are introduced or performance is optimized. For developers aiming to specialize in database engineering, Mastodon offers lessons in iterative design and scalability. Our goal with Liam ERD is to support that exploration, helping you dive deep into Mastodon’s data design without losing your way.
mastodon/db/schema.rb at main · mastodon/mastodon - Liam ERD
How Liam ERD Empowers OSS
Mastodon brings open-source values to life. Its code is fully public, contributions are welcomed worldwide, and the development process is transparent. This openness—together with its responsiveness to user feedback—reflects a strong culture of collaboration that aligns perfectly with Liam ERD’s mission to share knowledge and tools for everyone’s benefit.
Before Liam released their ERD, we asked Mastodon about featuring it, and we were especially pleased when Mastodon agreed to feature their ERD on our site. This underscores Mastodon’s commitment to transparency and its desire to help others learn from its platform. Such a spirit of shared resources and ideas drives supportive, innovative communities.
Mastodon’s user-centric decision-making also shows how agility and responsiveness can flourish when diverse voices have a say. The project tackles bugs, adds features, and evolves efficiently while remaining true to its vision—showcasing how shared ownership fosters sustained progress.
I believe many open-source projects have well-designed databases that often go underappreciated due to their lack of visibility. While text-based documentation can be overwhelming for potential contributors, visualizing the structure makes it much easier for maintainers, developers, and newcomers to understand how everything fits together.
We see Liam ERD as more than a diagramming tool—it’s a way for anyone, including non-developers, to understand a project’s data architecture and see where they can contribute. That approach matches the open-source principle that good ideas can come from anyone.
Making database structures easy to visualize also boosts inclusivity. When relationships are clearly outlined, anyone can jump in and say, “I know how to help.” Mastodon’s steady growth—fueled by contributors of all skill levels—demonstrates the impact of this openness.
GitHub - liam-hq/liam: Automatically generates beautiful and easy-to-read ER diagrams from your database.
Open Source and Transparent Schemas
Mastodon’s robust database and Liam ERD’s visual approach complement each other naturally, both driven by the belief that sharing and accessibility accelerate progress. By showcasing Mastodon’s underlying structure, we aim to lower barriers and inspire people to learn, collaborate, and innovate.
Clarity and transparency in database design amplify a software project’s potential. Developers work more confidently when they can see a clear map, and open-source communities thrive when people learn from one another’s work. This blend of technical excellence and human-centered collaboration continues to propel software forward for anyone ready to join in.
Text byTakafumi Endo
Takafumi Endo, CEO of ROUTE06, which develops Liam. After earning his MSc in Information Sciences from Tohoku University, he founded and led an e-commerce startup acquired by a retail company. He also served as an EIR at Delight Ventures.
Last edited on