April 22, 2024

Why leading organizations choose Liquibase over Flyway for database DevOps

So you’re ready to bring DevOps to the database by automating change management. But you’re unsure how to distinguish the leading solution, Liquibase Pro, from an alternative, Flyway Enterprise (Redgate). 

Or maybe you’re ready to switch from Flyway to Liquibase and want to know what to expect from a different tool with advanced capabilities for change management automation, governance, and observability.  

Innovative database, application, DevOps, and data teams at organizations worldwide turn to Liquibase – it has been downloaded over 100 million times! Liquibase Pro stands out against Flyway Enterprise in a few key ways, including:

  • Artifact-based deployments (instead of state-based) that empower better collaboration, easier rollbacks, and smaller, more frequent deployments
  • Advanced DevOps capabilities for better governance, standardized workflows, and visibility for continuous optimization
  • Expansive database support to expand DevOps automation and best practices to every team, project, and environment, supporting rapidly scaling and flexible pipelines with a single solution

Different approaches to database deployments

The first step to understanding how Liquibase differs from Flyway is to learn the different approaches to database deployments. 

Part of the reason for Liquibase’s superior capabilities is its embrace of artifact-based deployments, an innovative evolution of the migration-based approach. Before explaining the artifact-based deployment method and its benefits, let’s review the two most common deployment approaches: state-based and migration-based. 

State-based database deployments involve a tool that compares a snapshot of the database’s current state to an intended future state and then deduces what changes need to be made. After the tool provides a list of changes to achieve the desired state, those changes are then merged with the current database.

Migration-based deployments take a more granular and iterative approach by merging smaller updates with the database pipeline. A series of change scripts are created that outline the explicit, atomic steps needed to bring the database into its updated, intended state. Instead of a single, complex change directive derived from a diff comparison, migration-based deployments make changes one by one in a specific order. 

This allows developers to write database code just like they develop application code. They can push smaller, more frequent and manageable changes through a collaborative, version-controlled pipeline that validates and tests before releasing the changes to production. 

Liquibase Pro primarily uses migration-based deployments and packages the changes into artifacts. By leveraging this artifact-based approach, Liquibase makes it easy to align to DevOps best practices and maximize collaboration, flexibility, and control in database deployments. 

Liquibase’s majority artifact-based approach only uses state-based comparisons when appropriate, like for drift detection. Flyway Enterprise relies on state-based deployments – and that causes problems.

The downsides of state-based deployments

Comparing the current database state to the intended state and deploying that whole stack of changes – easy enough, right? Problem is, state-based change derivation makes a lot of assumptions that can cause problems down the line and cancel out the automation benefits upstream. 

We’ll use an analogy to illustrate the assumptions made by state-based comparison tools like Flyway Enterprise. Let’s say you currently have a red car, but would like to have a car that is blue instead. 

Ideally, you would just paint your car blue. You (or your paint shop) would follow the logical steps to sand, prep, and paint a new blue shade from bumper to bumper. Think of this as a migration-based approach to getting your blue car. 

On the other hand, a state-based approach would look at your current state (red car) and future state (blue car) and deduce that you’ll need to delete (sell) the red car and replace it with a blue car. That approach might reach the desired blue car state, but it’s not the proper execution. 

This new car is a blue car, but it’s not your car turned blue. You’re going to go through many more steps to make this one functionally yours. The state-based approach made too many assumptions, which means you’ll have to go back and address the applied changes to avoid problems in the future.

Relying only on state comparisons to derive database changes is risky. Parallel development streams can cause merge issues since comparisons to different databases (QA, staging, prod) or comparisons after changes have unknowingly been deployed will return different and often clashing results. This leaves the door open to misalignment, errors, and delays and brings up a lot of questions, such as:

  • Which states should be compared? 
  • How is that comparison being made? 
  • Have changes unknowingly been made to either state?
  • Are your teammates comparing the same states?

A state-based approach also hinders flexibility. Because all changes are grouped together, you can’t easily break out changes into subsets if only part of a change request needs attention. This also means teams lose the ability to embrace small, incremental changes, which is fundamental in DevOps principles. 

Once all of the changes are generated, Flyway Enterprise stores them as SQL files and uses the git commit order to derive the naming convention. Flyway’s sequencing is based on filenames, which are implicitly determined by the git commit order, so skipping, rolling back, or reordering changes is a very manual process. 

While state-based deployments have their useful place – we’ll cover drift detection and more in just a bit – the migration-based approach is most aligned with DevOps culture and most successfully integrated into CI/CD pipelines. 

That’s why Liquibase embraces the migration approach, evolving the method to be even more efficient, flexible, and collaborative with an artifact-based approach

Liquibase’s enhances migration-based deployments with artifacts

The migration-based approach to database deployments is the DevOps-aligned method that helps teams automate and accelerate database change management by developing database code just application code.. 

Liquibase takes the migration method a step further by embracing the artifact-based approach. 

Artifact-based deployments are a kind of migration-based deployment that embraces the engineering mindset and packages small, atomic, iterative changes (ChangeSets) into artifacts called ChangeLogs. These artifacts are committed to version control before being reviewed, tested, and deployed. 

Each artifact, or ChangeLog, contains minute components – ChangeSets – that make up the broader change code, explicitly defining the granular details of each deployment. Each ChangeLog and its ChangeSets have its own metadata that enables tracking and analytics, as well as the ability to update, reorder, and deploy changes quickly. Users can explicitly define the order in which each ChangeSet should be deployed, enabling more control and flexibility. 

The granularity and specificity of ChangeSets also allow for better collaboration among teams, who can work on parts of ChangeLogs without stepping on each other’s toes or breaking code. 

Why is artifact-based deployment a better method?

The artifact-based approach treats database change as a fluid, collaborative, properly reviewed and tested artifact rather than a more forceful change directive whose consequences aren’t entirely known. Because changes are treated as smaller, iterative packages grouped into defined batches, Liquibase helps teams match the pace and cadence of the application development pipeline and align on smaller, more frequent deployments.

Liquibase treats a ChangeLog as a collection of more minor changes that can all be individually reviewed and tested, so a ChangeSet can be fixed and optimized before deployment without derailing the rest of the ChangeLog artifact. 

In classic DevOps thinking, this innovative artifact-based approach uses smaller-scale changes as part of one whole change request, so you don’t just deploy and then succeed or fail entirely without detail or context. Instead of having to rename files as you might in Flyway, Liquibase’s artifacts are built for collaboration, making it easy to update and move changes around as requirements and deadlines change. 

The metadata within ChangeSets includes Labels and Contexts, which give granular information about each element of the update, helping make the changeset artifact more than just a SQL change script committed to source control. Instead, it packages a contextualized, collaborative, observable asset that can be promoted and monitored throughout the pipeline. This detailed artifact metadata makes it easier to use advanced capabilities, including:

  • Targeted rollbacks
  • Automatic validation
  • Greater and more granular control and governance
  • Workflow analytics and observability

Teams looking for a complete, powerful database DevOps solution – with more than just the ability to automate a simple deployment – look to Liquibase. 

State-based capabilities in Liquibase

Liquibase uses artifact migration-based deployments for its core change management automation features, However,, sometimes state-based methods do have their place. State can still be used, when appropriate, by an individual contributor to derive the changes, but never as a sole tool to deliver the changes. 

Liquibase uses state comparisons to understand differences in database state through inspection commands. Liquibase Pro’s Drift Reports give a detailed analysis of differences, and drift detection automatically does state-to-state comparisons to alert teams of any unwanted or malicious changes. 

Liquibase’s advanced DevOps capabilities

Liquibase Pro suits the needs of high-performing teams with advanced features for:

  • Automation
  • Collaboration
  • Standardization
  • Governance
  • Compliance
  • Security
  • Observability

…and more.

In comparison to Flyway Enterprise, users find Liquibase Pro can better meet the needs of teams and pipelines that strive for speed, integrity, and continuous optimization. Among a comprehensive database DevOps toolkit, class-leading features include Flows, Quality Checks, Structured Logging, and Targeted Rollbacks.

Flows

For consistency in every deployment and the confidence that best practices are ingrained in every update, Liquibase Flows give teams the power to standardize their expertly orchestrated change workflows into redeployable Flow files. Flows are a unique feature to Liquibase. Flyway does not offer a way to orchestrate consistent, reusable deployment workflows across teams and projects. 

This reusability makes it easy to create self-service database change workflows for development teams and roll them out across a variety of pipelines without having to custom-build each unit’s own workflow. As the needs and controls of database deployments and the broader CI/Cd pipeline evolve, Flows can be easily updated and redeployed to keep teams consistent and aligned with the latest requirements. Once initiated, these Flows can be easily executed by developers who can trust their ChangeLog will make it through the pipeline successfully.

Quality Checks

Liquibase Quality Checks enable teams to customize rules and policies for on-demand execution or within the automated change management workflow. When you want to protect compliance and security while giving developers the confidence to submit safe database code, it takes a more powerful governance capability. 

Compared to Flyway’s similar offering, Liquibase Quality Checks offer even stronger, more granular control across more types of databases. 

Structured Logging 

Every step in the Liquibase change management process is meticulously and automatically logged as it makes its way through automated checkpoints within Flows, such as Quality Checks. If those logs aren’t actionable, though, they’re just taking up space. Liquibase transforms log data into Structured Logs, which organize them into a standardized machine-readable format that plays nicely with DevOps monitoring dashboards. 

Structured Logging enables rich and informative database observability with pipeline analytics and change operation monitoring. These metrics and reports enable insights for continuous process optimization and easier, more helpful analysis, troubleshooting, and auditing. Teams deploying database changes with Flyway don’t have this visibility, nor the capability to drill down into deployment metadata to troubleshoot and optimize.

Targeted Rollbacks

No matter the severity of the problems at hand, executing a database rollback shouldn’t be a complex or stressful process. With Liquibase, every minute aspect of a database change is packaged with a rollback script, so it’s easy to roll back all changes or cherry-pick specific changes with a Targeted Rollback. 

Liquibase’s rollback procedures are included as a part of each ChangeSet within every ChangeLog artifact, giving that granular visibility and traceability that allows teams to undo any change in any order without disrupting anything else. Without artifacts, Flyway’s database rollback capabilities take a bit more configuration to execute. With Liquibase, the flexibility to roll back changes is built into every ChangeSet.

These benefits alone give compelling reasons to switch to Liquibase. Teams also consider which databases integrate with Liquibase today, tomorrow, and years into the future. 

Stronger support for more databases

In support of the varied and innovative landscape of modern data stores, Liquibase supports more than 60 different databases and is committed to a steady flow of even more. Explore the index of supported databases, and you’re likely to find the ones your teams use today, plus the innovative new technologies that can bring more value to your organization.

Compared to Flyway, Liquibase’s database integrations provide more advanced and robust capabilities and features. Adopting Liquibase means that you can standardize and automate change management across all of your databases – and when you expand or change your tech stack, Liquibase easily grows with you.

Arm your teams with the leading database DevOps solution 

Ready to embrace Liquibase’s evolved approach to database schema migration? Don’t get bogged down in traditional state-based migrations that are large, complex, tedious, slow-moving, and error-prone. Take the database DevOps approach with Liquibase 

Bring your whole team on board – we’ve made the case for Liquibase easily shareable in this downloadable Liquibase vs. Flyway comparison guide.

If you’re eager to dive into Liquibase Pro, start your free trial or get a demo

Share on: