Close

Database, Datastore, Backup

Bloonix requires two databases. One database for management, another for storing metrics. For better performance, the metrics are stored in partitions, one partition per day.

To install the database and set up the backup script for the datastore, the bloonix-server-schema package is required.

Database

The database for management is installed by default with the user and database name blxdb. To do this, you must change to the directory /usr/share/bloonix/schema/, where the scripts for setting up the databases are located.

cd /usr/share/bloonix/schema/
./init-postgresql-database -i -m -o /etc/bloonix/database/main.conf

Datastore

The database for storing the metrics is installed in a similar way. The user and database name are blxds by default:

cd /usr/share/bloonix/schema/
./init-postgresql-database -i -d -o /etc/bloonix/datastore/main.conf

Backup

The backup of the management database can be done quite easily using the typical tools pg_dump and mysqldump. Bloonix provides a special backup and restore script for the datastore that contains the metrics. The scripts are

  • bloonix-datastore-backup
  • bloonix-datastore-restore

A cron job can be set up for the backup script, which can be executed every 15 minutes. The script incrementally backs up the datastore under /var/backup/bloonix-datastore.

Supported DBMS

PostgreSQL is the only supported database system.

MySQL, MariaDB, and their derivatives are not supported. The main reason is the state of the available database drivers and packages: the Python modules for MySQL and MariaDB provided by the Debian and Rocky Linux repositories have known issues when working with JSON columns or do not reliably return JSON data in the expected format. In practice, this requires workarounds and project-specific adjustments (for example custom converters or type casts), which makes installations less reproducible and significantly increases maintenance effort.

In addition, MySQL typically requires the official mysql-connector, which is not available from the standard distribution repositories. When using MariaDB, the Python module is also often not usable out of the box and has to be installed manually (for example via pip), including the necessary adjustments.

Independent of this, PostgreSQL also offers clear advantages in terms of performance. Especially in larger setups with a high number of metrics, PostgreSQL generally operates noticeably more efficiently than MySQL or MariaDB.