Production-grade database deployment on Rocky Linux 9 — MySQL, PostgreSQL, and MariaDB with performance tuning, replication setup, and secure remote access.
Install MySQL 8.x from the official MySQL DNF repository — not the AppStream module — to get the latest version with full InnoDB optimisation, JSON support, and window functions.
PostgreSQL is the most feature-rich open-source RDBMS — JSONB, full-text search, table partitioning, logical replication, and ACID compliance. Install from the official PGDG repository for the latest stable release on Rocky Linux 9.
| Feature | MySQL 8 | PostgreSQL 16 |
|---|---|---|
| JSON Support | ✔ JSON | ✔ JSONB (indexed) |
| Full-Text Search | ✔ Basic | ✔ Advanced |
| Table Partitioning | ✔ Yes | ✔ Declarative |
| Logical Replication | ✔ Yes | ✔ Yes |
| Extensions | Limited | ✔ PostGIS, pgvector… |
| Popularity (web apps) | ✔ Very High | High |
MariaDB is a drop-in MySQL replacement with additional storage engines (Aria, ColumnStore), Galera Cluster for synchronous multi-master replication, and a more permissive open-source licence. Available from the AppStream module on Rocky Linux 9.
A 3-2-1 backup strategy: 3 copies of data, 2 different storage media, 1 offsite. Automate it with cron.
Portable SQL dump. Slow on large DBs but human-readable. Best for dev/staging or small datasets.
mysqldump -u root -p --all-databases --single-transaction > /backup/full-$(date +%F).sql
Hot physical backup for InnoDB — no table locks, incremental, stream to S3. Best for large production MySQL.
xtrabackup --backup --stream=xbstream --compress | aws s3 cp - s3://bucket/backup.xbs
pg_dump for logical, pg_basebackup for physical streaming backup with WAL archiving to support PITR.
pg_basebackup -h localhost -U replicator -D /backup/pgbase -Ft -z -P
Wrap backups in a cron job. Keep 7 daily, 4 weekly, 12 monthly. Alert on failure with systemd OnCalendar.
0 2 * * * /usr/local/bin/db-backup.sh >> /var/log/db-backup.log 2>&1
We deploy, tune, and manage MySQL, PostgreSQL, and MariaDB on Rocky Linux — with replication, backup automation, and ongoing performance monitoring.