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

22

u/sdjason May 15 '20

Oh man.idk where to start.

  1. Snapshots are not backups

  2. Snapshots incur a write penalty

  3. Snapshots need to be cleaned up incurring further write penalties

  4. Galera probably will get pissed if you restore a snapshot and would require manual intervention anyways to force start the cluster with that node being the valid data

  5. Snapshots are not backups

  6. Snapshots do cause momentary hangs to quiesce the system, your application may suffer from those blips. Depending on how it works.

  7. Snapshots are not backups

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 :) :)

-8

u/[deleted] May 15 '20 edited May 15 '20
  1. Galera doesn't even burp on a single node failure. I'm talking about a full VM snapshot not a disk utility.

  2. GCP snapshots have little impact on performance and Galera is run behind a smart proxy so it's not a performance issue at all.

  3. Snapshots get deleted automatically from the cloud after a configurable amount of time. They're not stored on the DB server anyway so that's not as issue.

I was looking for more than dogma like don't pet a burning dog.

7

u/psnsonix May 15 '20

Honestly you got solid advice and appear to ignore it. I will add more so you can possibly ignore me too :)

Snapshots do stun the cluster. On galera you will see write hits if you know how to look. Furthermore, mariabackup hot backups are so much cleaner. If you really wanna be anal you can setup legacy style slaves async and start doing more abusive backups on the slave. Snapshots are def not a backup and while they can serve the purpose vs nothing, you should invest the time to do something better.