How to backup MySQL database with zero downtime
Choosing the right backup solution is most important for any database. People always choose a backup solution that has the below qualities a) Minimal Downtime b) Consistent data c) Less restoration time There are several backup solutions like mysqldump, mysqlhottcopy, Xtrabackup, raw copy using cp/rsync/scp (and of course MySQL Enterprise backup. we are not going to talk about it here) etc.., I always prefer mysqldump when the data size is small(few GBs) even if it locks the tables. But what if the data size is huge in TB's, you cannot bring down the DB for a whole day. No client is comfortable with this, they need minimal or no downtime. Percona's Xtrabackup actually comes in handy in such situations. Xtrabackup locks the tables only when dumping the meta data. But what we are really interested here is LVM snapshot. With LVM snapshots we could actually take backups with zero downtime. Requirements ...