Database / Liquibase interview questions
What is the difference between Liquibase and Flyway?
Liquibase and Flyway are the two dominant Java database migration tools, and they share the same core goal — versioned, automated schema management — but differ in philosophy, flexibility, and feature set.
| Aspect | Liquibase | Flyway |
|---|---|---|
| Migration format | XML, YAML, JSON, or formatted SQL | SQL or Java callbacks only |
| Rollback support | Built-in, per changeSet | Manual — requires writing separate undo scripts (Pro only for auto-undo) |
| Diff/comparison | diff command compares two databases or snapshots | No built-in diff; requires external tooling |
| Conditional logic | preconditions, contexts, labels, runOnChange, runAlways | Limited — mostly relies on versioned file naming |
| Checksum handling | Strict — fails on checksum mismatch | Strict for versioned migrations; repeatable migrations re-run on checksum change |
| Tracking table name | DATABASECHANGELOG | flyway_schema_history |
| Spring Boot integration | spring-boot-starter-data-liquibase or spring.liquibase properties | spring-boot-starter-flyway or spring.flyway properties |
Flyway is often praised for its simplicity — you name your files V1__create_table.sql and Flyway handles the rest. Liquibase is more powerful but has a steeper learning curve. Teams that need fine-grained rollback, database-agnostic migrations (writing once and targeting Oracle, PostgreSQL, MySQL), or complex conditional logic tend to prefer Liquibase. Teams that want minimal configuration with plain SQL scripts often prefer Flyway.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
