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

  1. Introduction: Why Database Versioning Matters
  2. Core Concepts: Changelog, Changeset, and Tracking Tables
  3. Changelog Formats: XML, YAML, JSON, and SQL — When to Use Each
  4. Your First Migration: MySQL Setup and Running liquibase update
  5. Core Commands: update, rollback, status, history, validate, diff
  6. Spring Boot Integration: Zero-Config Setup and Full Properties Reference

Part 2: Everyday Patterns

  1. Changelog Organization: Master Files, include/includeAll, Directory Structures
  2. Common Migration Patterns: 12 Real-World Schema Changes with MySQL
  3. Rollback Strategies: Automatic, Custom, Tag-Based, and Count-Based
  4. Contexts and Labels: Multi-Environment Filtering
  5. Preconditions: Guard Your Migrations with tableExists, sqlCheck, and More
  6. Property Substitution: Environment-Specific Values in Changelogs

Part 3: Production Patterns

  1. Stored Procedures, Views, and Triggers in MySQL
  2. MySQL-Specific Patterns: Character Sets, Engines, Large Table Migrations
  3. Diff, Snapshot, and Reverse Engineering: Onboarding Existing Databases
  4. Rollback in Production: Tag-Based Strategies and CI Validation
  5. Zero-Downtime Deployments: The Expand-Contract Pattern
  6. Team Collaboration: Naming Conventions, Conflict Prevention, Git Workflow

Part 4: CI/CD and Operations

  1. CI/CD Integration: GitHub Actions Pipeline for Database Deployments
  2. Testing Migrations: H2 vs Testcontainers vs Real MySQL
  3. Kubernetes Deployments: Jobs, Init Containers, and Helm Hooks
  4. Adopting Liquibase on an Existing Production Database
  5. Troubleshooting: 10 Common Liquibase Errors and How to Fix Them
  6. Best Practices Reference: The Complete Liquibase Checklist