Baron Schwartz's Website
Archives Talks

MySQL Disaster Recovery by Promoting a Replica

Published Jan 20, 2009 by Baron Schwartz in Databases, High Availability, Open Source at https://www.xaprb.com/blog/2009/01/20/mysql-disaster-recovery-by-promoting-a-slave/

I was just talking to someone who backs up their MySQL servers once a day with mysqldump, and I said in a catastrophe, you’re going to have to reload from a backup; that’s some amount of downtime, plus up to a day of lost data.

And they said “We can just promote a replica, we’ve done it before. It works fine.”

Granted, in some/many cases, this is fine. There are all sorts of caveats—for example, you either know that your slave has the same data as the master or you don’t care. But it’s fine for some things.

So then I said “what about DROP TABLE?”

And there was a pause. I assume they were realizing that the chance of accidental or malicious destruction of data is much higher than the chance of multiple servers dying at once. This is why replica != backup.

How about you?

Granted, you can use a delayed replica to protect against this particular scenario. But you still need “real” backups, and you still have to think about the worst case—restoring that backup.

Baron Schwartz

I’m the founder and CTO of VividCortex, author of several books, and creator of various open-source software. I write about topics such as technology, entrepreneurship, and fitness. More about me.

Story logo

© 2019 Baron Schwartz