Spring Boot & Microservices (50 Qs)•Part 2: Persistence, Transactions & Security (11 - 24)
What is Flyway or Liquibase and why use them over `ddl-auto=update`?
junior LevelState ManagementSecurity & AuthDatabases & SQL
In Simple Words:
- Never use
hibernate.ddl-auto=updatein production: it cannot rename columns, cannot handle complex data transformations, and can inadvertently drop constraints. - Flyway: Executes versioned SQL migration scripts (
V1__init.sql,V2__add_status.sql) sequentially, tracking executed migrations in aflyway_schema_historytable, guaranteeing repeatable, deterministic database schema across all environments.