# Online Schema Migration for MySQL

> Run large MySQL schema changes without downtime. Bytebase picks Online DDL or gh-ost by table size, drives the shadow-and-cutover, and throttles on replica lag — all behind SQL review, approval, and audit. Self-hosted, open-source.

Source: https://www.bytebase.com/online-schema-migration/

---

## Run large MySQL schema changes without downtime.

On a large InnoDB table an ALTER can lock writers for a full rebuild, and MySQL falls back to a locking COPY without telling you. Bytebase picks Online DDL or gh-ost by table size and runs it online — so the migration ships without taking production down.

## Online DDL or gh-ost, chosen by the change.

### Online DDL when it's safe

For changes MySQL can do in place — INSTANT or INPLACE — Bytebase runs them natively, with no shadow table to manage.

### gh-ost when COPY is too costly

When MySQL would fall back to a locking COPY, Bytebase routes the change through gh-ost: a shadow table built from the binlog, then an atomic cut-over, throttled on replica lag.

### No gh-ost to operate

Bytebase drives gh-ost end to end — no shadow tables, throttling flags, or cut-over scripts to babysit on a production box.

## Reviewed, sequenced, audited.

### Lock-aware SQL review

100+ rules flag locking DDL, missing algorithm hints, and backward-incompatible operations before the migration merges.

### Sequenced rollout

Changes deploy dev → staging → production in order, so the same migration is proven on lower environments before it touches prod.

### Governed end to end

The gh-ost run sits inside the change workflow — risk-tiered approval, no direct production access, and a full audit trail — not a script run by hand.

## Read in order.

### Start with MySQL Online DDL

INSTANT, INPLACE, COPY — what each one rewrites, what each one locks, and when MySQL falls back. /blog/mysql-online-ddl

### Reach for gh-ost when COPY is too costly

On a billion-row table, MySQL's COPY fallback can take hours and stall replicas. gh-ost reads the binlog, builds a shadow table, and swaps it in. /blog/gh-ost-based-online-schema-migration-for-mysql

### Operate it safely at scale

The operational side — lock duration, replica lag, batching, and when to throttle a large migration. /blog/mysql-schema-migration-best-practice

## Get Started

- [Contact us](https://www.bytebase.com/contact-us/)
- [Start now (cloud)](https://console.bytebase.com)
