HeadlinesBriefing favicon HeadlinesBriefing.com

Mariabackup: Fast Hot Physical Backups for MariaDB

DEV Community •
×

Mariabackup, MariaDB's native tool, delivers hot physical backups that keep the database running. By copying InnoDB tablespaces and replaying redo logs, it sidesteps the downtime that logical dumps impose. For production systems where every second counts, this method becomes the default choice.

Unlike mysqldump, which writes SQL statements and can stall large databases, Mariabackup copies raw files and supports incremental snapshots. The tool captures a global lock only for a few seconds, allowing continuous reads and writes. This speed advantage makes it attractive for databases over ten gigabytes.

Installing Mariabackup is straightforward across distributions. Debian and Ubuntu users install the mariadb-backup package; RHEL/CentOS customers use yum or dnf. Docker images bundle the utility, and the binary is available on the command line. Matching the backup tool to the server version is essential to avoid incompatibilities.

After a backup, the prepare phase applies redo logs to create a consistent snapshot. Restoration requires stopping MariaDB, moving the data directory, and fixing ownership. For added security, Mariabackup can encrypt backups with AES256, and tools like Databasus automate scheduling, compression, and notifications.