Liquibase® version 3.8.5 is now available! Get it for free.
News All Previous Posts >>

Subscribe for email updates

- and/or -

Achieving Continuous Delivery at Fidelity Investments with IBM UrbanCode and Datical

Database Change Management: State and Migration Approaches

When it comes to managing databases, there are two types of deployment approaches:

  • State-based (Declarative) deployment
  • Migration-based (Imperative) deployment Both approaches, at their root, are about the source of truth: the definition of how you want the database to look at the end or the scripts you produce to handle database change.

State-based Database Deployment

In a state-based database deployment, the ideal state of the database is defined and a tool is used to compare that ideal state against the current actual state of the database. Some tools, like Liquibase, can analyze the difference between the two and generates all the scripts to change the database.

Diagram of state-based deployment

Migration-based Database Deployment

In a migration-based database deployment, specific migrations for altering the state of a database are described by the user. It’s all about capturing individual change scripts during development. This approach helps teams more closely align with Agile and DevOps best practices:

  • Small, incremental changes
  • Use the same process for all code delivery
  • Enables fast feedback loops
  • Granular control of features
  • Enables better testing
  • Eliminates drift
Diagram of Migration-based deployment

This approach allows you to iteratively modify the structure of your database over time, just as you do with your application code.

Can both approaches be used?

Yes! While Liquibase does include comparative (diff) capabilities, Liquibase is primarily a migration-based tool. The diff capabilities are mostly intended to assist with onboarding new projects or ensuring that your database migrations are applied correctly.