Senior Track Roadmap

Large scale migrations: gh-ost

Large schema changes behave differently from small ones because lock duration grows with table size. This course covers Postgres lock modes and the lock queue, the safe subset of changes such as concurrent indexes and NOT VALID constraints, and lock_timeout with strong_migrations as guardrails. It explains how gh-ost copies a MySQL table into a shadow table by reading the binary log, and how to run it with throttling and a postponed cut-over. It closes with pg-osc, expand/contract, batched backfills and a migration runbook.

What you'll learn

  • ✓Postgres lock modes, lock duration and the lock queue
  • ✓Non-blocking rewrites of indexes, constraints and NOT NULL, enforced by strong_migrations
  • ✓How gh-ost uses a shadow table and the MySQL binary log
  • ✓Running gh-ost with throttling, chunk sizing and a postponed cut-over
  • ✓Expand/contract and batched backfills on Postgres
  • ✓A runbook for rehearsing, watching and aborting a migration
Free preview · Lesson 1 4 min read

The migration that locked the table

A deploy goes out at 14:02. It carries one migration:

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...