It all started with a small experiment on installing the Synapse messaging server on a
smartphone with the Ubuntu Touch operating system , and ended up creating a small home data center on 5 ARM mini servers (Raspberry Pi and ODROID-XU4), whose main function is to provide the exchange system messages / calls via Matrix and WebRTS for 10 users.

Matrix is an open instant messaging protocol (based on decentralized servers) that allows users to exchange text messages and files, make voice and video calls, create chat channels, etc.
The most well-known client for the Matrix network is Riot.im, implemented as a mobile, web or desktop application. In terms of functionality, it is not inferior to customers of modern Slack / Telegram / WhatsApp messengers.
So, after installing on a smartphone (the server is difficult to use when it is in your pocket and all the time changes its address and connection method - WiFi / 3G / 4G), the next step was to transfer the system to one Raspberry Pi. Front-end is the implementation of
the Synapse server in Python , back-end is the PostgreSQL database from the standard Raspbian for Raspberry Pi distribution.
Connection to the Internet - via port forwarding (port 8448) on a home vDSL modem with a static external IP address.
')
Everything worked, but sometimes with a “scratch” - there were occasional delays - connecting clients took a few seconds, timeouts when connecting to third-party channels / rooms matrix.org.
After transferring the PostgreSQL database to the second Raspberry Pi, performance improved noticeably, but still 100% load of one of the processor cores occurred within a few minutes (on the front-end side).
To improve the situation, the front-end was transferred to the fanless
ODROID-XU4 (8 ARM cores, 2 Gb of RAM, server price - $ 59), and then the PostgreSQL database was transferred to the second ODROID-XU4.

A USB Ethernet switch ($ 20) was added to connect servers over a twisted pair, an external USB drive of 2 Tb, as well as a 6-port USB charging for powering 3 Raspberry Pi and Ethernet switches.
The released Raspberry Pi was converted: firewall to provide DMZ, Zabbix server for monitoring, hot standby server for PostgreSQL database (located in another room). Another Raspberry Pi with a mobile Internet access module was added to receive the second communication channel through the 4G module for the Raspberry Pi.
In addition, an uninterruptible power supply UPS was added.
During installation, the system looked like this (placed inside the electric fire):

The size of the Synapse back-end database has grown in half a year by ~ 325 Mb:

The size of the Zabbix monitoring system database has grown to 1.25 Gb and will soon stabilize:

Download external network (schedule for 7 days):

Download the internal network (schedule for 7 days):

The load graph on the front end for 3 days:

When encryption is enabled on clients, encrypted data is stored in the database, so even physical access to the server will not lead to data leakage.
All of the above can be implemented on low-cost VPS in any data center, but if it works stably at home, why not do it on home equipment?