This episode covers how to change schemas and migrate data without downtime: VReplication's role in data migration, online schema changes with MySQL mechanisms, and the vtctlclient workflow for running safe migrations in production.

In the world of Vitess, changing a schema can't be done by pressing Enter on a single server. Tables are spread across many shards, and every shard has its own MySQL. A plain ALTER TABLE on a large table will lock it and cause unacceptable downtime. Episode 10 covers how to change schemas and migrate data safely, without interrupting service.
Episode 10 roadmap: why online migration is needed, the engines behind it (VReplication and online schema change), the vtctlclient workflow, and a zero-downtime migration checklist.
Imagine a table with hundreds of millions of rows. Running ALTER TABLE ADD COLUMN directly will lock the table during the process — in MySQL, many ALTER operations use MDL (metadata lock) or rewrite the table. During that time, applications can't write, and on a 24/7 workload that's a disaster.
Vitess provides three paths for schema changes:
gh-ost or pt-osc via vreplication to run the ALTER without locking the old table.Vitess supports running ALTER through an online mechanism. The way: send the DDL with a special hint through VTGate, and Vitess runs it as an online operation using vreplication:
ALTER TABLE users ADD COLUMN bio varchar(500)The command above is sent through VTGate with the online option. Vitess creates a temporary table, copies data little by little while monitoring replication, then switches to the new schema. Applications never lose write access.
Info
For large tables, always use online schema change rather than direct DDL. Vitess will run the change across all shards consistently and report its progress — you can monitor when the migration finishes.
To monitor an ongoing online migration:
vtctlclient OnlineDDL Show allvtctlclient OnlineDDL Show lists online migrations, their status (queued, running, complete, or failed), and the progress on each shard.
VReplication is the binlog-based data copying engine that's the backbone of Vitess data migration: resharding (episode 16), cross-keyspace migration, and online schema changes all use it. Here's how it works:
Because the migration runs incrementally, the application never stops — that's the essence of a zero-downtime migration.
vtctlclient VReplicationExec -json <tablet-alias> "select * from _vt.vreplication"vtctlclient VReplicationExec runs a query directly against the _vt.vreplication table on a tablet — the internal table that stores the status of every VReplication stream.
Vitess packages the migration flow as a workflow. Examples include a keyspace migration workflow (MoveTables) or shard merging (ShardMerge). The typical flow:
vtctlclient MoveTables -source=... -tables=... commerce usersvtctlclient VReplicationExec ... statusvtctlclient SwitchTrafficvtctlclient Completevtctlclient MoveTables --source=commerce --tables=orders --target=users create order_move
vtctlclient Workflow --keyspace=users show order_move
vtctlclient MoveTables --source=commerce --target=users order_move switchtraffic
vtctlclient MoveTables --source=commerce --target=users order_move completeThe vtctlclient Workflow ... show command displays the workflow status — which steps are done and how much replication lag remains.
Before running a large migration in production, prepare this checklist:
Warning
Never cut traffic before you're sure the target has caught up with a safe lag. The switch step is the riskiest point; take the time to confirm the target is consistent with the source.
In this episode 10 you understood how to change schemas and migrate data without downtime: direct DDL only for lightweight changes, online schema changes for ALTER on large tables, VReplication as the data copying engine, and the MoveTables workflow flow with the create, switch, and complete stages.
Key takeaways:
ALTER doesn't lock the table.vtctlclient Workflow show is the tool for monitoring migration status.In the next episode, episode 11, we handle configuration and secrets: configuration management and secrets — customizing Helm and ConfigMaps, managing secrets for MySQL credentials and topology, and validating and rolling back production changes. See you there!