Liquibase
By Liquibase (Datical/Precisely)
Liquibase is an open-source library for tracking, versioning, and deploying database schema changes, letting teams manage schema evolution the same way they manage application source code.
Definition
Liquibase is an open-source library for tracking, versioning, and deploying database schema changes, letting teams manage schema evolution the same way they manage application source code.
Overview
Liquibase treats database schema as a versioned artifact. Instead of hand-running ALTER TABLE statements against production, developers describe each schema change as a "changeset" in XML, YAML, JSON, or plain SQL, and Liquibase applies those changesets in order, tracking which ones have already run in a metadata table inside the target database. This makes schema changes repeatable and auditable across environments — the same changelog that stood up a developer's local PostgreSQL instance can be replayed against staging and production with predictable results. Because changesets are plain text, they fit naturally into a CI/CD pipeline: a pull request that adds a column or index ships alongside the code that depends on it, and Liquibase runs automatically as part of deployment. It also supports rollback definitions, context/label-based filtering (so a changeset can be limited to certain environments), and diffing between two databases to auto-generate a changelog. Liquibase is database-agnostic, supporting MySQL, PostgreSQL, Oracle, SQL Server, MongoDB, and many others through drivers and extensions, which makes it a common choice for organizations running heterogeneous database estates. Its closest alternative in the Java/JVM ecosystem is Flyway; both solve the same core problem of schema migration but differ in configuration style and changeset format flexibility. In practice, Liquibase is most often introduced alongside an ORM such as Hibernate or JPA, where the ORM handles object-to-table mapping and Liquibase handles the actual DDL history, keeping schema changes explicit and reviewable rather than auto-generated at runtime.
Key Features
- Changesets written in XML, YAML, JSON, or SQL with unique IDs and checksums
- DATABASECHANGELOG tracking table records what has already been applied
- Rollback support for reverting individual changesets or entire releases
- Context and label tags to scope changesets to specific environments
- Diff and snapshot commands to compare schemas and auto-generate changelogs
- Broad database support including PostgreSQL, MySQL, Oracle, and SQL Server
- CLI, Maven/Gradle plugins, and Spring Boot integration for pipeline automation
- Preconditions to guard changesets against running in the wrong state or environment