4 ms·
Do you backup the present schema and data before the new migration is done ? And then if you rewind, you "simply" point to that backup scehma and data instead
by danielovichdk 5y ago
Do you backup the present schema and data before the new migration is done ?
And then if you rewind, you "simply" point to that backup scehma and data instead of the newly migration?
I know it's very simplified, but is this the gist of it?
- shlomi-noach 5y agoIt's not like that -- that BTW is super simple to achieve with either of the existing online schema change tools (pt-online-schema-change, gh-ost, facebook's OSC) -- they all end up with your old table renamed away, and which you can instantly reinstate back in place. Very cool and important feature! But then, you lose data; all the data you've accumulated since the migration completed; or some data you've deleted will suddenly reappear. Rewind does not move you back to an old snapshot, but rather keeps you on your current timeline, with the current data, but with the old schema. Technically, there are two tables involved, yes! And a synching mechanism that compensates for the structural differences between them. But perhaps I should just point to this technical explanation of how this works internally: https://planetscale.com/blog/behind-the-scenes-how-we-built-rewind https://planetscale.com/blog/behind-the-scenes-how-we-built-...
- throwusawayus 5y ago> But then, you lose data; all the data you've accumulated since the migration completed; or some data you've deleted will suddenly reappear. this is not correct, for example pt-online-schema-change has long had a --reverse-triggers option which reverses the direction of the triggers to keep the old table up to date