MySQL Backup Strategies

MySql

There are several ways to take backups of MySql, and though not all are great, it really depends a lot on your situation. Having recently found the need for some heavy backing up, I had to do some deep research and decided to share. Here are some thought processes to use when choosing a backup strategy.

mysqldump

If your data set is small (I realize “small” is a relative term.. to qualify it, let’s say <10GB), then mysqldump will probably work great. It’s easy, it’s online and it’s very flexible. Just a few things mysqldump can do:

  • backup everything or just certain databases or tables
  • backup only the DDL
  • optimize the dump for a faster restore
  • make the resultant sql file more compatible with other RDBMSes
  • and much more…
  • However, the most important options are related to the consistency of your backup. My favorite options are: [More]