github / gh-ost

GitHub's Online Schema-migration Tool for MySQL
MIT License
12.43k stars 1.26k forks source link

[Question] strategy for multiple table alters #812

Open mike-code opened 4 years ago

mike-code commented 4 years ago

Imagine the migration alters two tables, but if I read the doc correctly gh-ost supports single table alteration. I understand that there's no "good way" of handling this kind of situation because even if you run migrations simultaneously (two instances of gh-ost), at some point you'll end up having one table migrated while the other one still in migration.

Do I assume correctly that the only right way here is just not allowing such migrations in the first place if you care about zero downtime?

tomkrouper commented 4 years ago

Can you give more details? In our situation we tend to run migrations that are backwards compatible. If two tables need to be altered to make something work, we might migrate table 1, then table 2. After that developers would make changes to the code and If necessary, we'd migrate table 1 or 2 a second time to complete the process.