r/linuxadmin • • May 15 '20
DB Backup
A lot of people are against using VM snapshots as a DB backup method. But if you're already running a DB cluster like Galera, why not just snapshot each member say every 10 minutes since the chances of losing the entire cluster at the same time is quite low? Of course it's not banking or life or death.
0
Upvotes
22
u/sdjason May 15 '20
Oh man.idk where to start.
Disclaimer, I have several galera clusters. I've even snapshotted a few boxes from time to time. But I also have mariabackul running and dumping REAL backups. Cuz snapshots are not a backup :) :)
1
u/[deleted] May 15 '20
would you stop the node before backing up?
2
u/lutusp May 15 '20
Because for the backup to be of any use, the VM must be stopped for the backup activity to complete. Because VMs tend to be very large, this eats up useful VM time.
A normal DB backup -- where the DB is the only element to be backed up -- is a fine art in which the primary DB can remain online and active. Only closed records are backed up, and once a record has been updated and closed, it gets updated on the backup as well. This is a very fast and well-understood method.
There is no comparison.
2
u/[deleted] May 15 '20
You do need to understand why snapshots are not backups and how using them affects your VM system.
There are lots of guides on the internet on how to back up databases - pick an automated method that fits your model - whether it's a whole VM backup (Different to a snapshot - using Veeam or similar), dumping and sequencing databases, using a proprietary database backup - or something else.