The 2025 State of Database DevOps is here  —  Get the report!

Database Version Control

Guide

Table of contents

Unlike applications, databases are stateful. As a result, the database is one of the most valuable and important assets to any organization. Therefore, database version control is needed to ensure nothing is lost, broken, or unintentionally changed as changes to the database are deployed.

According to Google Cloud’s DevOps Research and Assessment (DORA) team in their  2024 Accelerate State of DevOps Report, elite DevOps performers are 3.4 times more likely to incorporate database change management into their process than low performers. DORA’s philosophies align with Liquibase on the value of database version control as part of a robust database release automation strategy that embraces database DevOps. 

In this guide to database version control, you can learn:

What is database version control?

Database version control, or database versioning, is applying version numbers to snapshot states of a database schema. Database version control systematically manages these versioned changes to a database's schema and objects, enabling teams to track, apply, and revert changes with precision and reliability. This capability ensures that database environments remain consistent across development, testing, and production stages, facilitating collaboration among team members, reducing deployment risks, and extending DevOps to the database workflow.

Database version control emphasizes the tools and processes involved in tracking, managing, and applying changes to the database. It's about the mechanisms that allow for the safe, collaborative development of database schemas and objects, similar to how version control systems like Git manage changes to source code – hence the term Git for databases (database GitOps)

Why do databases need version control?

Today’s application developers wouldn’t dream of working without version control. Most software developers have been reaping the benefits of easier collaboration and increased productivity. Most database development teams don’t have the right tools or processes in place yet.

The database release bottleneck

Organizations need to manage both application and database changes to accelerate the pace of software delivery. To this end, there has been a sharp growth in database source control and version control database tools to bring transparency and automation to application code as it moves from development to production. 

However, the same is not true for database schema changes and database schema version control. The tools and techniques for database version management have remained relatively manual and stagnant. As a result, with application code releases accelerating, the database increasingly becomes a bottleneck that holds organizations back from faster software releases.

The importance of implementing SQL version control early

It’s possible to believe that database schema version control doesn’t apply to you because your database releases are not holding your organization back. At best, this is shortsighted thinking. A market study from Dimensional Research, The State of Database Deployments in Application Delivery found that database releases become a bigger issue as application releases accelerate. Those releasing applications weekly or faster report issues with their database release process much more than those who release monthly or slower. 

While bringing traceable version control to SQL code may initially seem unimportant, take heed and implement database version management before it’s too late. After all, most organizations reported that half of all significant application changes require database changes – meaning there is no avoiding database version control in accelerating overall software delivery and quality.

Methods of database version control

Fundamentally, there are two ways to define and manage changes to the database: state-based and migration-based.

State-based version control

The state-based approach begins with developers declaring the ideal database state and relying on tooling to generate SQL scripts based on comparing the ideal database state definition and a target database. 

While the state-based approach allows for a formal declaration of the database state that developers and other stakeholders can quickly access and understand, only using state-based comparisons makes it harder for teams attempting to bring their database release process in line with an agile DevOps software release process.

How well does state-based version control track releases?

A central tenet of DevOps is to “build once, deploy often.” By solely relying on comparison and generating a SQL script for each database release, there is no way for teams to ensure a consistent, repeatable database release process. By deploying potentially different SQL changes to different database environments, the state-based approach often falls short of effectively tracking and managing the database schema version of the databases that are part of a software development pipeline.

Migration-based version control

Instead of only tracking the ideal state of a database, an alternative approach to database version control is to track the specific changes that have been made to each database. Known as the migration-based approach, the actual database schema changes, SQL code changes, reference data changes, and other database changes are authored, built, and traced from development to production. Learn more in this guide to database schema migration

How well does migration-based version control track releases?

This methodology embodies the “build once, deploy often” DevOps philosophy, and allows teams to better understand exactly what has been deployed to each database. By using an artifact to encapsulate the changes, the migration-based approach also provides a less risky, repeatable, and consistent approach to database releases.

Hybrid approach: state-based and migration-based

You can use both approaches together. Liquibase starts with a migration-based approach, promoting small changes via changesets and changelogs that can be tracked via source control. Liquibase also allows teams to compare database schemas via diff commands to more easily detect malicious code (such as ransomware) and database drift. 

Database version control benefits

  • Discuss the primary benefits of database version control; we go into detail about the challenges, so we should showcase the benefits. (Plus, competitive articles are doing this)
  • Benefits to cover:
    • Change tracking
    • Improved collaboration
    • Error reduction
    • Rollbacks
    • Automated deployments
    • Audit and compliance
    • Enhanced testing

Database version control challenges

Driven by undeniable benefits in speed, consistency, accuracy, and reliability, teams might charge ahead with a version control process without taking a thoughtful and strategic approach. Some things to consider as you work to bring version control to your database pipelines include:

  • Tracking complexity that increases as you scale and evolve, especially in environments with frequent deployments
  • Coordination across distributed teams that lack unified visibility throughout the pipeline and change process
  • Database rollbacks without impacting the integrity of the environment or data
  • Detecting drift that can occur from out-of-process changes, improper access permissions, or other unintentional updates that cause the actual state to differ from the expected version-controlled state

Luckily, the right version control tool minimizes these risks through automation, customization, governance, and observability capabilities. 

Database version control tools

There is a mix of open source and commercial database version control tools that can be used to allow teams to track changes over time. Given that migration-based version control tools are best suited for organizations attempting to accelerate software delivery, consider looking into the leading open-source or commercial solution if you are ready for database version control.

Four requirements for database version control tools

Visibility into your database versioning is crucial in reducing the chance of downtime caused by application failures that result from improperly configured databases. Effective DB version control also decreases the chances of irrecoverable data loss from updates that accidentally drop or delete data. 

Ultimately, it is critical, especially when trying to accelerate software releases, to have a good SQL database version control solution in place so that you can provide a consistent, high-quality end-user experience while allowing your business to function smoothly without interruption.

Here are four requirements you should aim for when considering database version control solutions:

  1. Look for a tool that allows database code to flow through a unified, transparent pipeline along with application code. This enables better ROI from existing application release automation (ARA) investments, allows teams to keep application and SQL changes in sync, reduces errors or confusion if a feature set needs to be accelerated or dropped for a release, and eliminates the overhead of two separate and duplicate processes for promoting code from development to production.
  2. The database version control tool needs to be able to validate SQL code with automation. Without this ability, SQL code will continue to lag behind the application code. Database schema versioning alone is not enough – database code needs to move at the same pace as application code, which is only achievable if SQL code validation is as automated as it is for application code.
  3. The tool needs to be able to generate an immutable, idempotent artifact for downstream deployment. This core DevOps tenant is an important aspect of database version management. With a packaged artifact of validated and versioned database code, it’s easy for teams to maintain and manage the evolution of database schema.
  4. The tool should detect and help address drift. When making process changes, it’s common for users to regress to manual, undocumented SQL changes. Regardless of how it happened (a lapse in user judgment or a panicked response that resulted in an out-of-band update to a database schema), it’s important when there are updates to a database schema that the SQL database version control tool detects and fosters reconciliation.

    Without the ability to detect drift, this can give teams a false sense of security. Worse, it can contribute to an outage due to a database change colliding against an undocumented change that was previously deployed.

Bring database version control to your pipelines

Liquibase is an open-source, migration-based version control database solution. With Liquibase, you can organize your changes into changelogs, which are rearrangeable, editable sets of changes. This tracks which changes have been deployed to a database and what additional changesets should be applied to to migrate a database schema to a specific version.

Liquibase supports XML, JSON, YAML, and SQL for defining changesets so that database schema changes can easily be translated to other DBMS platforms.

Here’s more information on the two plans Liquibase offers:

Liquibase Open Source

Liquibase Open Source is a great starting point for teams addressing the challenges that come with managing database changes. It works well for smaller teams and projects that have ample time to invest in extending and adapting the open source automation capability to meet their needs.

Liquibase Pro

Liquibase Pro adds expert support and advanced capabilities that enhance and extend the Liquibase Open Source features, so you can enable DevOps best practices at the database. These include:

The best way to enable database version control in your change management process is with an automation solution like Liquibase. Find out how Liquibase works to enable version control, CI/CD, observability, and more. 

No items found.