Connect.IT Mastodon instance on STACKIT

Norman Ziebal, 5 April 2023

What is Mastodon

Mastodon is a social media network that is free, open-source, decentralized, and distributed. It was launched in 2016 as a competitor to centralized social media platforms like Twitter and Facebook. Mastodon is a federated network in which users can join any instance of their choice and connect with other users. Although each instance is autonomous, they are all connected to form a larger network.

Mastodon operates in a similar fashion as Twitter does, with users able to post short messages known as “toots” that can include text, images, videos, and other data. Users can follow other users in order to view their toots on their timeline and promote (i.e. re-share) toots they enjoy. Mastodon also includes features such as hashtags and mentions, as well as a moderating mechanism that allows instances to enforce their own community rules.

One of the primary differences between Mastodon and centralized social media networks is the emphasis on privacy and data ownership. User data is not collected or sold by Mastodon, and users have the ability to retain ownership of their data, allowing them to download and backup their information at any given time.

Benefits over traditional Social Networks

Numerous things have led to Mastodon’s rapid rise in popularity. Here are four important considerations:

Concerns regarding privacy: There have always been growing concerns about the privacy and security of user data on centralized social media platforms. Mastodon’s decentralized and federated structure, as well as its emphasis on user privacy, have made it an enticing alternative for those concerned about the usage of their data.

Censorship: Censorship, particularly of political expression, has been charged of centralized social media networks. Because Mastodon is decentralized, each instance may set its own rules and moderation criteria, allowing for greater freedom of expression.

Community: Mastodon has a robust and supportive user base that appreciates its decentralized structure and dedication to anonymity. This has helped to attract new users looking for an alternative to more popular social networking sites.

Growing interest in decentralized technology: There has been a spike in interest in decentralized technologies, such as blockchain and distributed systems, in recent years. Mastodon is part of this trend, and its decentralized and distributed nature has drawn the attention of individuals interested in this type of technology.

Who is Connect.IT

Connect.IT is a regional IT network based in the Heilbronn-Franken area of Germany that was established in 2014. With a mission to empower IT, Connect.IT aims to promote communication and collaboration between companies, suppliers, manufacturers, science and educational institutions, potential employees, students and pupils.

The organization boasts approximately 100 member companies and organizations, including well-known names such as HS Heilbronn, Experimenta, Bechtle and Schwarz IT. Connect.IT’s wide-ranging Board of Trustees includes representatives from TUM, DHBW, 42, the City of Heilbronn, the IHK Heilbronn-Franken and Campus Founders, ensuring a diverse range of perspectives and expertise.

Connect.IT is well-known in the region for its events, such as the popular BarCamp, NightCamp and IT im Fluss. These events bring together IT professionals, entrepreneurs and students to network, exchange ideas and learn from one another.

Objective

The Connect.IT Mastodon instance connectit.social aims to give the association and its members with a solid and scalable social media platform. Some major characteristics have been considered in the deployment of the Mastodon instance:

  1. Redundant Deployment: The Mastodon instance has been redundantly deployed to provide maximum dependability and availability, with data and compute resources preserved in multiple locations to mitigate failures or outages.

  2. High Availability: The Connect.IT Mastodon instance has been intended to be highly available, which means that it should be accessible to users at all times with minimal downtime.

  3. Deployment with Zero Downtime: The instance’s deployment has been designed to be zero downtime in order to deliver a smooth user experience. This allows upgrades and maintenance to be performed without interfering with the platform’s availability to users.

  4. Scalability: As the number of users and data saved on the platform grows, the Connect.IT Mastodon instance has been designed to be extremely scalable, allowing it to handle increased traffic and storage demands without losing performance or availability.

With a focus on the aforementioned characteristics, the platform is well-equipped to meet the demands of the Connect.IT community today and in the future.

Architecture of Mastodon

The section that follows describes the technical structure of the Mastodon application. The core application, includes the underlying Mastodon code and is responsible for processing requests and delivering replies to users.

Mastodon with STACKIT Services

The Node streaming API is utilized for real-time updates on toots and timelines, ensuring that users are constantly up to speed with the most recent material on the site.

Mastodon employs Sidekiq for background processing to guarantee that resource-intensive operations do not degrade platform performance for users.

Redis is used to provide faster replies by caching and synchronization of background processes, which helps to minimize database load and enhance overall performance.

The database stores all the coded information connected with the Mastodon instance, including user accounts, posts and references to media assets.

A string search engine, which provides quick and versatile search capabilities, is used to do searches on toots, users, tags and other content.

The Asset storage serves non-coded data such as images and videos. This module should offer a scalable and dependable solution for storing and serving huge volumes of multimedia material.

Used STACKIT offers

Connect.IT Mastodon solution has been designed to offer a seamless experience to its users by leveraging the robust services of STACKIT. The platform is characterized by its high availability, scalability and flexibility, making it an ideal solution for individuals and organizations seeking communication and collaboration opportunities in the Heilbronn-Franken area.

The Connect.IT Mastodon combines several STACKIT services. In place of the asset storage component, the solution implements STACKIT Object Storage, which provides a secure and reliable way of storing information.

The solution’s database is the scalable STACKIT PostgreSQL system. Furthermore, the integration of STACKIT Elasticsearch has improved the traditional string search capabilities. The solution also makes use of STACKIT Redis, which aids in database load reduction and background job coordination, resulting in enhanced performance and faster answers.

The core application, Sidekiq and the streaming API are all hosted as containerized applications on STACKIT Kubernetes Engine (SKE), which simplifies deployment and scalability.

Finally, the solution employs the STACKIT yawol load balancer, which ensures balanced traffic distribution and prevents downtime or slow performance for users.

Platform Deployment

Mastodon Deployment on STACKIT

The deployment of Connect.Mastodon IT’s solution to SKE leverages the use of a Helm chart, a package manager for Kubernetes. A Helm chart is a collection of templates and metadata that specify application components and dependencies, making it easier to deploy, maintain and update Kubernetes applications.

We used the Helm chart supplied by the Mastodon community to streamline the deployment process. This Helm chart contains a pre-configured set of templates and metadata that specify Mastodon’s components and their dependencies. To link Mastodon’s components with STACKIT services, this Helm chart was employed.

High Availability

The Mastodon instance of Connect.IT was made highly available by utilizing the STACKIT availability zones (AZ). AZ’s are physical and logically independent zones within a cloud region of STACKIT. They are meant to ensure the resilience and fault tolerance of cloud services. Each AZ has its own separate power, cooling and local network connections, preventing one AZ’s failure from impacting applications running in other AZs.

Mastodon Zero Downtime and High Availability

We deployed two SKE Node pools in two separate AZ’s to improve the availability of the Mastodon instance. Node pools are groupings of Kubernetes worker nodes that execute containers and host applications.

By having multiple Node pools in different AZ’s, the workloads can easily be shifted to another AZ in the event of a failure, ensuring that the application continues to run without interruption and stays operational. This implies that if one AZ fails, the nodes in the other AZ may take over and continue to run the application without interruption.

Further we use the yawol load balancer in combination with a metro deployment. The metro deployment method distributes resources across multiple availability zones, increasing resilience and fault tolerance in the case of an availability zone failure. We can properly control and disperse incoming traffic by implementing the yawol load balancer, ensuring the smooth operation of our services.

Zero Downtime

Zero downtime is of utmost importance to ensure maximum availability for the Users of the Connect.IT’s Mastodon instance. This term means that the service is continuously accessible, even during updates or upgrades.

To achieve zero downtime, we make sure that each node pool has at least one available node. This allows to upgrade nodes separately, without impacting overall service availability. If an availability zone experiences failure during upgrades or updates, the other node pool remains available to manage incoming traffic.

We utilize the rolling updates feature of Kubernetes to keep Mastodon updates running without any downtime. Rolling updates allow us to gradually upgrade the cluster by updating individual nodes one by one, making sure that the Mastodon instance remains accessible to users during updates.

Conclusion

The Connect.IT Mastodon instance connectit.social was built by leveraging STACKIT Services with redundant deployment, high availability, zero downtime and scalability in mind. The instance offers the association and its members with a powerful and scalable social media platform, while simultaneously encouraging privacy, data control, and community-driven ideals.

The Mastodon instance’s redundant deployment protects against failures or outages by keeping components in multiple locations. This, together with the platform’s high availability functionality, enables users to utilize the platform with no downtime at all times. Because of the zero downtime feature and the flexibility to expand the number of nodes in the node pools, administrators may make changes to the platform without impacting operations. Furthermore, the platform’s scalability mechanism ensures that it can manage increased traffic and a rising user base, making it a dependable and scalable option for both users and administrators.

The platform’s varied features make it a significant resource for members of the Heilbronn-Franken IT business, as well as a communication and collaboration tool that empowers the IT community.