3 ms·
Please correct me if I'm wrong, but aren't migrations a solved problem in databases that support triggers? * create a new schema in a table.new * install upda
by notyourday 9y ago
Please correct me if I'm wrong, but aren't migrations a solved problem in databases that support triggers?
* create a new schema in a table.new
* install update triggers on table.old to write the same content into table.new
* backfill table.new from table.old
* swap table.new and table.old
- qaq 9y agoand now say you have a 1TB table still want to go this route ?
- notyourday 9y agoYes, the bigger the table the safer this route is for online migrations.
- qaq 9y agoThat would highly depend on the nature of migration :)
- zmoazeni 9y agoNo. https://githubengineering.com/gh-ost-github-s-online-migration-tool-for-mysql/ https://githubengineering.com/gh-ost-github-s-online-migrati... has an excellent section on why triggers fail (at least in the MySQL world. I imagine the locking story is similar in postgresql). I don't work for GitHub but we had the same problems using pt-online-schema-change independently of their issues (lots of locking contention affecting the app negatively). We're finally moving to gh-ost for our large/risky migrations and so far it's amazing.