busy production environments, where making a table unavailable for minutes or hours is not practical.” 1. Keeps a temporary log to store inserted/updated/deleted data 2. Alters the table in-place 3. The log gets replayed on altered table
table’ with altered schema 2. Repeat until original and ghost table converge a. Create INSERT/UPDATE/DELETE triggers on original table b. Copy existing data on original table to the ghost table 3. Cutover(swap the ghost table with original)
Copying `lockjoyUS`.`raw_data_conversions`: 43% 08:40:40 remain Copying `lockjoyUS`.`raw_data_conversions`: 43% 08:42:10 remain 2018-05-03T15:04:12 Dropping triggers... 2018-05-03T15:04:14 Dropped triggers OK. Not dropping the new table `lockjoyUS`.`_raw_data_conversions_new` because --no-drop-new-table was specified. To drop the new table, execute: DROP TABLE IF EXISTS `lockjoyUS`.`_raw_data_conversions_new`; `lockjoyUS`.`raw_data_conversions` was not altered. 2018-05-03T15:04:12 Error copying rows from `lockjoyUS`.`raw_data_conversions` to `lockjoyUS`.`_raw_data_conversions_new`: Threads_running=1845 exceeds its critical threshold 1000
with altered schema 2. Repeat until original and ghost table converge a. Stream binlog from original table and apply on the ghost table b. Copy rows from original table onto ghost table 3. Cutover(swap the ghost table with original)