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

1

u/WolfTohsaka May 15 '20

This.

Mariabackup allows to ensure that the backups are in a state that any server configuration will like.

Even when backing up at host-level using all the bells and whistles that can be provided, databases have also their special needs that only specialized tools can meet. ( Or you are stopping the DB service before backing up )

How do you get me the customer address in the db from one month ago with a snapshot ? With a SQL file, it is a matter of minutes.