On 09/03/14 11:43 AM, Stephen Harris wrote:
On Sun, Mar 09, 2014 at 11:28:07AM -0400, Digimer wrote:
Would you mind elaborating on this? If a snapshot is a point-in-time image of a VM (or even normal FS), why would DB backups be at risk (assuming things like fsync are used)?
I'm asking in general terms... no idea if this is something AWS specific.
Database disk snapshots may include "transactions in flight" and the on-disk image may not be in a consistent state. Databases such as Oracle try to work around this by ensuring that writes occur in a specific order and have a good "recovery" process (each data file has a change number; determine the best change number to start from, roll forward from there to recover, then roll back any incomplete transactions) but it's considered "crash recovery" and shouldn't be part of BAU activity. Other databases may not be so good at recovery (mysql?) and so you run the risk of database corruption if you need to restore the snapshot.
If you rely on disk snapshots then it's recommended you do a proper db dump before the snapshot is taken, so that you can recover the database from the dump file and not the snapshot.
Thanks for the reply, Stephen. I also replied to Nico, and my comments there can be directed to you, as well. :)