MySQL replication continuously synchronizes data from a primary (master) server to one or more replica (slave) servers. While replication is primarily for high availability and read scaling, it also provides a form of backup protection.
How Replication Works
The primary server writes changes to its binary log. Each replica reads the binary log and applies the same changes to its own data. Replication is asynchronous by default — the replica may lag slightly behind the primary.
Using a Replica for Backups
You can run mysqldump on the replica without impacting the primary server. Pause replication on the replica before taking the dump for a consistent snapshot, then resume it. This offloads backup I/O from the production primary.
Limitations
- Replication is not a substitute for backups — accidental deletes replicate to all replicas
- Replica lag means data may not be 100% current
- Use delayed replication (MASTER_DELAY) to keep a replica N hours behind as a safety net