Re:GitHub's online schema migration for MySQL
by manigandham on Thursday May 03, 2018 @04:24AM
(#16984232)
These same databases have background/concurrent index rebuild features. Change DDL, add index, then switch over.
[ Parent
| on HN ]
Re:GitHub's online schema migration for MySQL
by jamespo on Thursday May 03, 2018 @05:31AM
(#16984493)
so background means the index isn't ready right?
Re:GitHub's online schema migration for MySQL
by manigandham on Thursday May 03, 2018 @12:42PM
(#16987527)
I'm not sure what the confusion is here. There's no downtime or slow serving as the first comment said because your app shouldn't be using any new columns until they're ready, whether that's through Ghost or transactional DDL + concurrent index rebuild.
Re:GitHub's online schema migration for MySQL
by viraptor on Thursday May 03, 2018 @06:07PM
(#16990442)
Sure, you can avoid it, but mostly with some effort. Specifically if you're manually changing the column type which is covered by an index, you'd have to:
Add a new column with a new index. Copy the old data over and change the code/add a trigger to keep them synchronised. Change the code to use the new column instead. Remove the sync code/trigger. Drop the old column/index. And you're potentially left with a weird name, because the purpose of the column didn't change, just the type.
Or you could use gh-ost and do it in one go, semi-automated without any code changes, and with the same column name.