This commit is contained in:
Nigini A. Oliveira 2023-12-07 19:02:00 +00:00 committed by GitHub
commit d806987acc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 2 deletions

View File

@ -9,9 +9,28 @@ menu:
Mastodon is a Ruby on Rails application with a React.js front-end. It follows standard practices of those frameworks, so if you are already familiar with Rails or React.js, you will not find any surprises here.
The best way of working with Mastodon in a development environment is installing all the dependencies on your system, rather than using Docker or Vagrant. You need Ruby, Node.js, PostgreSQL and Redis, which is a pretty standard set of dependencies for Rails applications.
## Architecture
Tutorials for installing these dependencies can be found on the “Installing from source” page in the Running Mastodon section of the documentation. Please keep in mind that root access to a machine running Ubuntu 18.04 is required. After following the installation guide in the Running Mastodon section, see the “Setting up a dev environment” page for further instruction on how to configure your environment for development.
Mastodon's architecture can be divided in the five sub-systems depicted in the image bellow:
{{< figure src="/assets/architecture.png" caption="Architectural layout of Mastodon." >}}
1. The web-server, who deals with the incoming HTTP calls from clients;
2. Mastodon's logic which implements the Tooting functionalities you love;
3. A job processing system (a.k.a. queuing framework) used by Mastodon's logic to process as needed tasks;
4. An "operations data system" which keeps needed information handy for quick access;
5. A persistent data storage system where all those toots and cat photos will be written and read from.
Because the Mastodon's logic is implemented in Ruby, as of now, all these systems are implemented on or easily integratable in a Ruby project stack. For instance, although one could imagine using any HTTP server or Queue framework, as of now, the default architecture uses [Puma](https://puma.io) and [Sidekiq](https://sidekiq.org), both Ruby libraries that made adding Web call-handling and Job processing conveniently easy to create.
In terms of data management, Mastodon uses the popular in-memory datastructure storage system [Redis](https://redis.io) which affords super-fast access to vital information like cached toot streams and Sidekiq's queues and its jobs. The final bit, the persistent storage, is accomplished by the [PosgreSQL](https://posgresql.org) for general data, and for media storage, Mastodon can use either a conventional filesystem or an Elastic Storage solution (a.k.a. storage bucket - initially created as the [S3 API](https://docs.aws.amazon.com/AmazonS3/latest/API/Type_API_Reference.html) by Amazon Web Services (AWS) and now implemented by most cloud service providers like Google, Azure, or Digital Ocean).
## Development
The best way of working with Mastodon in a development environment is installing all the dependencies directly on an Ubuntu Server, rather than using Docker or Vagrant. You will need to install all the software describe above -- e.g., Ruby, Node.js, PostgreSQL and Redis -- which is a pretty standard set of dependencies for Rails applications. You may also prefer to install your storage-components in dedicated servers, but there is a conversation for another time.
Tutorials for installing these dependencies can be found on the “Installing from source” page in the Running Mastodon section of the documentation. Please keep in mind that root access to a machine running Ubuntu (currently on 22.10) is required. After following the installation guide in the Running Mastodon section, see the “Setting up a dev environment” page for further instruction on how to configure your environment for development.
### Environments {#environments}

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB