gh-ost performs online MySQL table migrations without triggers, using binary log events to mirror changes. It supports throttling, pausing, auditing, and controlled cut-over timing.
Overview
gh-ost is GitHub's tool for changing large MySQL tables while production traffic continues. Like earlier online schema change utilities, it builds a ghost copy of the target table, backfills rows incrementally, and swaps names once data is consistent.
Instead of database triggers, it reads the replication binary log stream and applies row changes asynchronously to the ghost table. That design reduces coupling to the master's write load and avoids trigger-related operational risks called out for legacy tools.
Operators can test migrations on replicas without cutting over, pause copying and event application under throttle, reconfigure a running job, query status over TCP or a Unix socket, and delay the final table swap until a maintenance window. Hooks allow integration with surrounding automation.
Binaries are published for Linux and macOS, and the implementation is written in Go. Common workflows start with noop validation, then execute against a replica-attached master when statement-based replication requires it.
Key features
- No-trigger schema migrations
- Binary log change capture
- Replica-based dry runs
- True pause under throttle
- Interactive reconfiguration
- Postponed cut-over control
- Status via socket or TCP
- Cross-cluster table moves
Use cases
- Large production table alters
- Validating migrations on replicas
- Low-impact index or column changes
- Scheduled cut-over maintenance
- MySQL fleet schema rollouts