A schema change that worked on staging locks a 200-million-row table in production, or two engineers apply the same ALTER TABLE in different orders and the environments drift apart. Those are two different problems, and most teams need a separate tool for each. A versioning tool (Flyway, Liquibase, Atlas, Sqitch, Bytebase, or your framework's migrations) decides which change runs, in what order, and records that it ran. An online schema change executor (gh-ost, pt-online-schema-change, Vitess online DDL, pgroll, pg-osc, or MySQL's own ALGORITHM=INSTANT) decides how a change runs on a large, busy table without blocking writes. This list covers both families for MySQL and PostgreSQL as of November 2026: the model each tool uses, the engines it supports, its licence, one real command, and how to pair a versioning tool with an executor.
- Pick one versioning tool to own order and history, and add an online executor only for the changes your engine cannot do in place.
- Licences moved: Liquibase Community is under the Functional Source License from 5.0, and Atlas ships an Apache 2.0 Community build beside its standard binary.
- On MySQL 8.4, adding, dropping, and renaming columns can run with
ALGORITHM=INSTANT; type changes still copy the table, which is where gh-ost or pt-online-schema-change come in. - On PostgreSQL, pgroll and Reshape serve old and new schema versions through views, while pg-osc copies the table into a shadow table and swaps it.
- Liquibase (through liquibase-percona) and Bytebase (through gh-ost) can hand a change to an executor for you; with other tools you wire the hand-off in CI.
Scope and review date: November 2026. Covers the tools below for MySQL 8.4 and PostgreSQL, including Liquibase 5.x, pt-online-schema-change 3.7.2, and Vitess 24. Licences, engines, and commands were checked against each project's documentation or repository on 25 November 2026. The commands were not run in a lab. Tools are grouped by use case, not ranked.
What is the difference between a migration versioning tool and an online schema change tool?
A versioning tool keeps ordered changes in Git and a history table in each database, so every environment ends up with the same schema. It does not care how long an ALTER TABLE takes. An online executor applies one change to a large table while the application keeps writing, usually by building a copy and switching to it at the end.
Flyway will run a statement that copies a huge table under a lock, because to it that is one more migration; gh-ost has no idea which migrations an environment has applied. You need both answers.
Where each family sits in a schema change
The versioning tool decides order and history; large-table changes take the executor path
Rule of thumb: one versioning tool per database, and an executor only on the path for changes the engine cannot apply without blocking writes.
What should a database schema migration tool give you?
Before comparing names, decide what you need from each family. For the versioning tool, check five things:
- Model: versioned (ordered files you write) or declarative (the tool computes the change from a desired schema).
- Engines: every database you run, in the edition you will pay for; some drivers sit in paid tiers.
- Licence: open source, source-available, or open core, which matters if you embed or resell it.
- Review and drift: the exact SQL in the pull request, and a warning when production no longer matches history.
- Executor hand-off: routing a change to gh-ost or pt-online-schema-change without a manual step.
For the executor: which engine versions, how it captures writes during the copy (triggers, binary log, or views), what it cannot handle, and who controls the cut-over.
Which SQL-first versioning tools should you consider: Flyway, Liquibase, and Sqitch?
These three keep changes as ordered scripts and a history table. They differ in licensing, in how a change is described, and in how they handle dependencies.
Flyway (Redgate)
What it is: a versioned migration runner. Files follow the V<version>__<description>.sql pattern, sorted numerically; R files are repeatable migrations that run after pending versioned ones, and U files are undo migrations run with the separate undo command, per the Flyway migrate documentation. The flyway/flyway repository says it supports more than 50 database systems, including Oracle, SQL Server, MySQL, PostgreSQL, MariaDB, and MongoDB.
Editions and licence: the Flyway editions page lists two editions as of November 2026: Community, described as free for individual developers and education, and Flyway Enterprise. Enterprise adds migration script generation from Redgate's comparison engine, undo script generation, drift detection, and policy checks. The open source repository is Apache 2.0. Enterprise pricing is by quote.
Best fit: plain SQL files and a simple model. Limits: drift reports and generated undo scripts are Enterprise features.
# sql/V2__Add_new_table.sql is picked up because of its name
flyway migrateInterpretation: migrate compares the files with the schema history table, creates that table if it is missing, and applies only the pending versions. Running it again with nothing pending changes nothing.
Liquibase
What it is: a changelog-based tool. Changesets can be written in SQL, XML, YAML, or JSON, per the Liquibase changelog documentation, and the non-SQL formats let one changelog target several engines.
Licence change: starting with Liquibase Community 5.0, the project moved from Apache 2.0 to the Functional Source License 1.1 (FSL-1.1-ALv2), as Liquibase announced on 30 September 2025. Production use and forks stay free; competing commercial offerings, such as a managed service, are not allowed. Each release reverts to Apache 2.0 after two years, and pre-5.0 versions stay Apache 2.0. The repository lists v5.0.3 (15 May 2026) as the latest release.
Best fit: multi-engine estates and teams that want rollback blocks next to each change. Limits: check the FSL terms if you build a product or hosted service around it.
liquibase update \
--changelog-file=changelog.xml \
--url=jdbc:mysql://db-01:3306/appInterpretation: --changelog-file names the root changelog and --url the JDBC connection; both are required, per the update command reference. Changesets already recorded in the database are skipped.
Sqitch
What it is: a dependency-aware change manager with no ORM or framework attached. A plan file records changes and their dependencies, and each change has deploy, revert, and verify scripts written in the engine's native SQL. The Sqitch repository lists PostgreSQL, YugabyteDB, CockroachDB, SQLite, MySQL, MariaDB, Oracle, Firebird, Vertica, Exasol, Snowflake, and ClickHouse. Licence: MIT.
Best fit: database-first teams, especially PostgreSQL shops with functions and views that depend on each other. Limits: you write revert and verify scripts by hand.
sqitch add users --requires appschema -n 'Creates table to track our users.'
sqitch deploy db:pg:flipr_testInterpretation: add writes the three scripts and records the dependency on appschema, so deploys run in a valid order. From the Sqitch PostgreSQL tutorial.
Which tools manage schema declaratively: Atlas and Bytebase?
Declarative tools start from the schema you want and compute the ALTER statements. Both tools here also support versioned files, so you can use the declarative mode to generate migrations and still review them.
Atlas
What it is: a schema-as-code tool with a declarative workflow (atlas schema apply) and a versioned one (atlas migrate diff, lint, apply), described in the Atlas getting started guide.
Licence: the Community Edition is a minimal Apache 2.0 build supporting MySQL, PostgreSQL, SQLite, and MariaDB. The standard binary is free to download under the Atlas MSA, and Atlas Pro features need a licence after a 30-day trial. Community lacks migration linting, drift detection, views, triggers, functions, and drivers such as SQL Server and Oracle.
Best fit: teams who want the database schema reviewed as a file, with generated migrations. Limits: much of the review tooling sits in Pro.
atlas schema apply \
--url "$DATABASE_URL" \
--to file://schema.sql \
--dev-url "docker://postgres/17/dev?search_path=public"Interpretation: Atlas diffs schema.sql against the live database, then shows a plan and asks for approval before applying it.
Bytebase
What it is: a web-based database change and governance platform with GitHub and GitLab integration. Its GitOps documentation describes SQL review on pull requests, then a release, plan, and rollout after merge. It supports migration-based files on all its databases and a state-based (SDL) workflow on PostgreSQL and MySQL; the SDL mode does not run data changes.
Licence: the repository LICENSE puts code outside the enterprise directories under the MIT (Expat) licence, enterprise directories under a separate enterprise licence, and plan and feature-enablement code under restrictions. It is open core, not a single licence.
Best fit: approvals, SQL review rules, and access control in one UI. Limits: it is a service to operate, not a CLI.
-- gh-ost = {}
ALTER TABLE orders ADD COLUMN note VARCHAR(64);Interpretation: in a GitOps file, the -- gh-ost directive on its own line tells Bytebase to run this MySQL change through gh-ost, per its online schema migration guide. gh-ost's working tables go into a separate bbdataarchive database.
Versioned and declarative migrations side by side
Switch models to see what you write, what you review, and where the truth lives
Versioned
| Aspect | Versioned |
|---|---|
| Source of truth | The ordered migration files |
| Who writes the ALTER | You, or a diff tool that generates the file |
| What reviewers read | The exact SQL that will run |
| Data changes | Written in the same files |
| Examples | Flyway, Liquibase, Sqitch, framework migrations |
Declarative
| Aspect | Declarative |
|---|---|
| Source of truth | The desired schema file |
| Who writes the ALTER | The tool, from a diff against the live schema |
| What reviewers read | The schema diff, then the computed plan |
| Data changes | Handled separately (Bytebase SDL does not run them) |
| Examples | Atlas schema apply, Bytebase SDL |
Common middle ground: edit the schema declaratively, generate a versioned file with atlas migrate diff, and review that file like any other migration.
Should you use your framework's migrations: Alembic, Django, Rails, or Prisma Migrate?
If one application owns the database, its framework's migrations are usually enough for versioning: they live next to the models and run in the same deploy. All four below are versioned and generate migrations from model changes.
- Alembic (SQLAlchemy, MIT, docs at 1.20.1):
alembic upgrade headapplies revisions;alembic downgrade -1steps back one, per the Alembic tutorial. - Django (BSD-3-Clause):
makemigrationscreates migrations andmigrateapplies them. The Django migrations guide warns that MySQL has no transactional DDL, so a failed migration must be unpicked by hand. - Rails (MIT, guide for 8.1):
bin/rails db:migrateandbin/rails db:rollback; use the:sqlschema format whenschema.rbcannot express triggers, per the Rails migrations guide. - Prisma Migrate (Apache 2.0):
prisma migrate devis for development only;prisma migrate deployapplies pending migrations in CI and production, per the Prisma workflow docs.
None of these frameworks chooses an online algorithm for you. A generated AlterField or change_column on a large MySQL table becomes an ordinary ALTER TABLE, so route large-table changes to an executor as described below.
Which online schema change tools work for MySQL?
Start with what MySQL can do itself, then reach for a copy-based tool.
MySQL INSTANT and INPLACE DDL
On MySQL 8.4, adding, dropping, and renaming a column, setting or dropping a default, and appending ENUM or SET members can run instantly, per the MySQL 8.4 online DDL operations page. Adding a secondary index runs INPLACE without a rebuild while reads and writes continue. Changing a column's data type is supported only with ALGORITHM=COPY, and reordering columns or changing NULL/NOT NULL rebuilds the table in place. Each instant add or drop uses a row version: the limit is 64 on 8.4 and 255 from MySQL 9.1.0. See our MySQL INSTANT DDL guide.
ALTER TABLE t1 ADD COLUMN c2 INT, ADD COLUMN c3 INT, ALGORITHM=INSTANT;
SELECT NAME, TOTAL_ROW_VERSIONS
FROM INFORMATION_SCHEMA.INNODB_TABLES
WHERE NAME = 'app/t1';Interpretation: writing ALGORITHM=INSTANT makes MySQL fail rather than silently copy the table. Near the row-version limit, the next instant add or drop fails with "Maximum row versions reached"; a rebuild resets the counter.
gh-ost
What it is: GitHub's triggerless online schema change tool for MySQL 5.7 and later (MIT). It creates a ghost table, copies rows in chunks, and applies ongoing changes it reads from the row-based binary log, then swaps the tables. Per its requirements and limitations, it needs ROW binary logs with a FULL row image, and does not support foreign keys or triggers on the table. The old and new tables must share a primary key or a non-null unique key.
gh-ost \
--max-load=Threads_running=25 \
--critical-load=Threads_running=1000 \
--chunk-size=1000 \
--host=primary.example.internal \
--allow-on-master \
--database="app" \
--table="orders" \
--alter="MODIFY COLUMN status VARCHAR(32) NOT NULL" \
--postpone-cut-over-flag-file=/tmp/ghost.postpone.flagInterpretation: without --execute this is a no-op run that checks the setup, per the gh-ost cheatsheet. Add --execute to copy data. While the flag file exists, gh-ost keeps the ghost table in sync but waits to cut over, so you choose the moment. Our pt-osc and gh-ost production guide covers throttling and cut-over in detail.
pt-online-schema-change
What it is: Percona Toolkit's trigger-based tool (GPL v2 or Perl Artistic License). It creates an altered copy of the table, adds triggers on the original so writes during the copy reach the new table, copies rows in chunks sized toward --chunk-time (default 0.5 seconds), then swaps the tables with an atomic RENAME TABLE and drops the original by default. Details are in the pt-online-schema-change 3.7.2 documentation.
pt-online-schema-change --alter "ADD COLUMN c1 INT" D=sakila,t=actor --dry-run
pt-online-schema-change --alter "ADD COLUMN c1 INT" D=sakila,t=actor --executeInterpretation: --dry-run creates and alters the new table but adds no triggers and copies nothing. Without --execute the tool only runs its safety checks and exits. Because it captures writes with triggers rather than the binary log, it does not depend on gh-ost's binary log settings, at the cost of extra write load on the original table.
Vitess and PlanetScale online DDL
What it is: Vitess (Apache 2.0) runs managed online schema changes. Set ddl_strategy to vitess, submit an ordinary ALTER TABLE, and Vitess returns a job ID, schedules the change on each shard's primary, and runs it as a VReplication workflow, per the Vitess 24 managed online schema changes guide. The DDL strategies page says the gh-ost and pt-osc strategies are not supported as of v22; the remaining strategies are vitess, mysql, and direct.
PlanetScale exposes the same engine through deploy requests from a development branch into a branch with safe migrations enabled. Per the deploy request docs, you can gate the cut-over and revert a deployment for up to 30 minutes afterwards; instant deploys cannot be reverted.
SET @@ddl_strategy='vitess';
ALTER TABLE orders MODIFY COLUMN status VARCHAR(32) NOT NULL;
SHOW VITESS_MIGRATIONS;Interpretation: the ALTER returns a migration UUID instead of blocking. SHOW VITESS_MIGRATIONS lists migrations and their status.
Three MySQL online executors compared
Switch tools to compare how each captures writes and who controls the cut-over
gh-ost
| Aspect | gh-ost |
|---|---|
| Captures writes from | Row-based binary log |
| Changes on the original table | None; no triggers added |
| Main limits | No foreign keys or triggers; ROW binlog, FULL image |
| Cut-over control | Postpone flag file |
| Licence | MIT |
pt-online-schema-change
| Aspect | pt-online-schema-change |
|---|---|
| Captures writes from | Triggers on the original table |
| Changes on the original table | Triggers added for the copy |
| Main limits | Trigger overhead on every write during the copy |
| Cut-over control | Atomic RENAME TABLE when the copy ends |
| Licence | GPL v2 or Perl Artistic License |
Vitess / PlanetScale
| Aspect | Vitess / PlanetScale |
|---|---|
| Captures writes from | VReplication workflow |
| Changes on the original table | Managed by Vitess per shard |
| Main limits | Requires a Vitess cluster or PlanetScale |
| Cut-over control | Gated deploys; 30-minute revert on PlanetScale |
| Licence | Apache 2.0 (Vitess) |
Choose by constraint: foreign keys or triggers on the table rule out gh-ost; a sharded Vitess estate already has its own executor.
Which online schema change tools work for PostgreSQL?
PostgreSQL can do several changes without blocking writes on its own. CREATE INDEX CONCURRENTLY builds an index without locks that block inserts, updates, or deletes, but it cannot run inside a transaction block and leaves an invalid index if it fails, per the PostgreSQL CREATE INDEX reference. That transaction rule matters: Django, for example, runs each PostgreSQL migration inside a single transaction by default, so check how your versioning tool wraps the statement. Our PostgreSQL safe DDL guide covers the native patterns. For changes the engine cannot do online, three tools take different approaches.
pgroll
What it is: Xata's open source tool (Apache 2.0) for reversible schema migrations on PostgreSQL 14 and later. It creates a versioned schema of views over the physical tables, so old and new application versions run side by side. Breaking column changes get a new column that is backfilled, with triggers keeping both in sync until you complete the migration, per the pgroll repository. Migrations are written in pgroll's JSON format.
pgroll --postgres-url "$DATABASE_URL" init
pgroll --postgres-url "$DATABASE_URL" start initial_migration.json
pgroll --postgres-url "$DATABASE_URL" complete # or: rollbackInterpretation: after start, new application instances set search_path to the new version schema (for example public_initial_migration); old ones keep the previous one. complete drops the old version.
pg-osc
What it is: pg-online-schema-change (MIT) runs any ALTER on PostgreSQL 9.6 and later through a shadow table. Per the pg-osc repository, it adds triggers that record changes in an audit table, copies rows into an altered shadow table, builds indexes, replays the audit table, and swaps the tables under a short exclusive lock, updating foreign keys. It needs TRIGGER privilege or superuser.
pg-online-schema-change perform \
--alter-statement 'ALTER TABLE books RENAME COLUMN email TO new_email' \
--dbname "postgres" \
--host "localhost" \
--username "jamesbond"Interpretation: this is the pt-online-schema-change model for PostgreSQL: one table, one change, a copy, and a swap. The repository states no maintenance status, so check recent releases first.
Reshape
What it is: an MIT-licensed migration tool for PostgreSQL 12 and later that, like pgroll, puts views in front of tables. A migration has three phases: start (views and triggers make both schemas work), roll out the new application, then complete, which removes the old schema, per the Reshape repository.
reshape migration start
reshape migration complete # or: reshape migration abortInterpretation: abort rolls back an incomplete migration without losing data. Check its release history too.
How do these schema migration tools compare side by side?
From each project's documentation or repository as of 25 November 2026. "Main engines" is not every driver.
| Tool | Family | Model | Main engines | Licence |
|---|---|---|---|---|
| Flyway | Versioning | Versioned | 50+ incl. PostgreSQL, MySQL, SQL Server, Oracle | Apache 2.0 (Community); Enterprise by quote |
| Liquibase | Versioning | Versioned changelog | Many; SQL, XML, YAML, JSON changelogs | FSL-1.1-ALv2 from 5.0 |
| Sqitch | Versioning | Versioned with dependencies | PostgreSQL, MySQL, Oracle, SQLite, and 8 more | MIT |
| Atlas | Versioning | Declarative and versioned | Community: MySQL, PostgreSQL, SQLite, MariaDB | Apache 2.0 Community; standard under Atlas MSA |
| Bytebase | Versioning | Migration-based and state-based | PostgreSQL, MySQL, SQL Server, Oracle, and more | MIT core plus enterprise licence |
| Framework migrations | Versioning | Versioned | Per framework | MIT, BSD-3-Clause, or Apache 2.0 |
| MySQL INSTANT/INPLACE | Executor | Native DDL | MySQL 8.4 and 9.x | Part of MySQL |
| gh-ost | Executor | Copy with binlog sync | MySQL 5.7+ | MIT |
| pt-online-schema-change | Executor | Copy with triggers | MySQL | GPL v2 or Artistic |
| Vitess online DDL | Executor | Managed VReplication copy | MySQL under Vitess, PlanetScale | Apache 2.0 |
| pgroll | Executor and versioning | Versioned views, expand and contract | PostgreSQL 14+ | Apache 2.0 |
| pg-osc | Executor | Shadow table with audit triggers | PostgreSQL 9.6+ | MIT |
| Reshape | Executor and versioning | Views, three phases | PostgreSQL 12+ | MIT |
pgroll and Reshape keep their own history and run changes online, so either can replace a separate versioning tool on PostgreSQL. For a deeper look at the two most common versioning tools, read our Liquibase vs Flyway comparison.
How do I pair a versioning tool with an online executor?
Two tools do the hand-off for you. The liquibase-percona extension (Apache 2.0) runs changes such as addColumn, createIndex, and modifyDataType through pt-online-schema-change on MySQL and MariaDB, and you switch it off per change with usePercona. Bytebase runs a MySQL change through gh-ost when the file carries the -- gh-ost directive. With Flyway, Sqitch, Atlas, or framework migrations, you build the routing into CI. The sequence below is the shape that works for MySQL; for PostgreSQL, replace the executor with pgroll or native concurrent DDL.
Routing one schema change through a versioning tool and an executor
Six steps for MySQL; only step 5 touches the production table's lock
-
Write the change as a migration file
The versioning tool owns the order and the history, even for changes another tool will run.
-
Lint and review the SQL in the pull request
Reviewers read the exact statement. Atlas, Bytebase, and Flyway Enterprise can add automated checks.
atlas migrate lint \ --dev-url "docker://mysql/8/dev" --latest 1 -
Test whether it runs instantly
On a staging copy, add ALGORITHM=INSTANT. If MySQL accepts it, the versioning tool can run it directly.
ALTER TABLE orders ADD COLUMN note VARCHAR(64), ALGORITHM=INSTANT; -
Dry-run the executor for everything else
A gh-ost run without --execute checks binlog format, keys, and privileges and changes nothing.
gh-ost --host=primary.example.internal \ --allow-on-master --database=app \ --table=orders --alter="MODIFY status VARCHAR(32)" -
Run the copy and cut over in a quiet period
Add --execute and a postpone flag file; remove the file when you are ready for the brief swap.
-
Record the change in the versioning tool
Mark the migration as applied in the way your tool supports, so the next environment does not run the ALTER a second time.
Main risk: step 6. If the history and the executor disagree, the next deploy repeats or skips the change. Decide how your tool records an externally applied migration before the first production run.
How do I choose between them?
Choose the versioning tool first, by who owns the schema:
- One application, one database: the framework's migrations.
- Several applications or engines: Flyway for plain SQL; Liquibase for multi-engine changelogs or the pt-osc extension, after checking the FSL terms.
- Schema reviewed as a file: Atlas, with the versioned workflow if you want history in Git.
- Approvals and access control in a UI: Bytebase.
- PostgreSQL with many functions and views: Sqitch for dependencies, or pgroll for side-by-side versions.
Then choose the executor by engine and table shape, as in the toggle above: native DDL first, then a copy-based tool.
Frequently asked questions
Is Liquibase still open source?
Not in the OSI sense from version 5.0. Liquibase Community 5.0 and later use the Functional Source License 1.1, which allows free production use and forks but bars competing commercial offerings. Each release converts to Apache 2.0 two years after it ships, and versions before 5.0 remain Apache 2.0. Liquibase describes FSL as source-available.
Can Flyway or Liquibase run gh-ost for me?
Liquibase can run pt-online-schema-change through the liquibase-percona extension on MySQL and MariaDB, switched per change with usePercona. Neither Flyway nor Liquibase runs gh-ost by itself. Bytebase can run a MySQL change through gh-ost. With Flyway, you route large-table changes to gh-ost in CI and record the migration as applied afterwards.
What is the difference between versioned and declarative schema migrations?
Versioned migrations are ordered files you write and apply in sequence, so the files are the source of truth. Declarative migrations start from a desired schema file, and the tool diffs it against the live database to compute the ALTER statements. Atlas supports both, and many teams generate versioned files declaratively so reviewers still read the exact SQL.
Key takeaways
- Versioning tools decide what runs and record it; online executors decide how a change runs on a busy table. Most teams need one of each.
- Check licences before you standardize: Liquibase 5.0 moved to FSL, Atlas splits a Community build from the standard binary, and Bytebase is open core.
- On MySQL, test
ALGORITHM=INSTANTfirst, then pick gh-ost or pt-online-schema-change by whether the table has foreign keys or triggers. - On PostgreSQL, pgroll and Reshape run old and new schema versions side by side; pg-osc copies and swaps one table.
- Decide how an executor-run change gets recorded in the versioning tool before the first production run.
Set up schema migration pipelines with JusDB
JusDB's database automation team can review your current migration process, help choose a versioning tool and an online executor for your engines, and build the pipeline that routes large-table changes through gh-ost, pt-online-schema-change, or pgroll with lock timeouts and pre-flight checks.
See what the engagement covers on the database automation services page.