Liquibase Tutorial — Complete Guide
A complete, hands-on Liquibase tutorial series for Java and Spring Boot developers. Master database change management with MySQL — from your first migration to zero-downtime production deployments.
Liquibase Tutorial — Complete Guide
This tutorial series teaches you to manage MySQL database changes with Liquibase — the standard tool for database versioning in the Java ecosystem. Every article uses real MySQL 8.x and Spring Boot 4.0.
What you’ll build: A complete e-commerce database (users, products, orders, payments) built up incrementally, with full Spring Boot integration, CI/CD pipelines, and production rollback strategies.
Part 1: Foundations
- Introduction: Why Database Versioning Matters
- Core Concepts: Changelog, Changeset, and Tracking Tables
- Changelog Formats: XML, YAML, JSON, and SQL — When to Use Each
- Your First Migration: MySQL Setup and Running
liquibase update - Core Commands: update, rollback, status, history, validate, diff
- Spring Boot Integration: Zero-Config Setup and Full Properties Reference
Part 2: Everyday Patterns
- Changelog Organization: Master Files, include/includeAll, Directory Structures
- Common Migration Patterns: 12 Real-World Schema Changes with MySQL
- Rollback Strategies: Automatic, Custom, Tag-Based, and Count-Based
- Contexts and Labels: Multi-Environment Filtering
- Preconditions: Guard Your Migrations with tableExists, sqlCheck, and More
- Property Substitution: Environment-Specific Values in Changelogs
Part 3: Production Patterns
- Stored Procedures, Views, and Triggers in MySQL
- MySQL-Specific Patterns: Character Sets, Engines, Large Table Migrations
- Diff, Snapshot, and Reverse Engineering: Onboarding Existing Databases
- Rollback in Production: Tag-Based Strategies and CI Validation
- Zero-Downtime Deployments: The Expand-Contract Pattern
- Team Collaboration: Naming Conventions, Conflict Prevention, Git Workflow
Part 4: CI/CD and Operations
- CI/CD Integration: GitHub Actions Pipeline for Database Deployments
- Testing Migrations: H2 vs Testcontainers vs Real MySQL
- Kubernetes Deployments: Jobs, Init Containers, and Helm Hooks
- Adopting Liquibase on an Existing Production Database
- Troubleshooting: 10 Common Liquibase Errors and How to Fix Them
- Best Practices Reference: The Complete Liquibase Checklist