Online schema migration

DesignHard40 minMeta and Uber style

Your task

Design an online schema-migration system to alter a 3-billion-row, 2 TB MySQL table that serves 50k QPS, where a naive ALTER TABLE would lock writes for hours. You need to change a column type and add an index with zero downtime and the ability to abort safely if load spikes. How do you perform the change, keep the old and new schemas in sync, and cut over?

It covers

  • Zero downtime ddl
  • Backfill
  • Shadow table