Flyway
ELI5 — The Vibe Check
Flyway is a migration tool that keeps track of every change you've ever made to your database schema, in order, like a meticulous diary. It runs SQL scripts numbered V1, V2, V3 and remembers which ones it's already applied. No more 'did we run that ALTER TABLE on production?'
Real Talk
Flyway is an open-source database migration tool that uses versioned SQL scripts (or Java migrations) to manage schema changes. It maintains a metadata table tracking which migrations have been applied, ensuring consistent schema state across environments. It supports most major databases and integrates with CI/CD pipelines.
Show Me The Code
-- V1__Create_users.sql
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email TEXT NOT NULL UNIQUE
);
-- V2__Add_name_column.sql
ALTER TABLE users ADD COLUMN name TEXT;
When You'll Hear This
"Flyway applies pending migrations on deploy automatically." / "We version all schema changes through Flyway scripts."
Related Terms
Database Branching
Database branching is Git for your database.
Liquibase
Liquibase is like Flyway's more enterprise cousin who wears a suit. It tracks database changes but uses XML, YAML, or JSON changelogs instead of raw SQL.
Point-in-Time Recovery
Point-in-time recovery (PITR) is the database equivalent of a time machine. Accidentally deleted all your users at 3:47 PM?