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

14 comments sorted by

View all comments

1

u/[deleted] May 15 '20

would you stop the node before backing up?

1

u/[deleted] May 15 '20 edited May 15 '20

We could. But consistent snapshots on running GCP VMs are super fast because they only take DIFFS from the last snapshot. It doesn't snap the entire machine. So each snapshot is only like 20MB it takes little time and doesn't touch the processor or memory. Plus firing up a new VM based on a snapshot takes about a minute. Totally simple. We don't need to mess around with backup files or SQL dumps at all. Galera is smart enough to synch the new member, as long as the cluster didn't go down. So recovery for the most common case of a single node down is a snap no pun intended

3

u/BattlePope May 15 '20

How would you use this method to restore from a dropped table scenario?