Key takeaway
- Database DevOps explained: source control, migrations, CI/CD and drift control, with Liquibase, Flyway and SSDT compared and an adoption sequence for CTOs.
Database DevOps means treating database changes like application changes: every schema change lives in version control, is tested, and reaches each environment through the same automated pipeline. According to DORA, database changes are a major source of risk and delay in deployments, and teams that bring them into the delivery process report that database changes do not slow them down or cause problems during code deployments.
For a CTO or platform lead the practical question is where the database sits in your pipeline today. If it sits behind a manual DBA review just before production, it is the bottleneck for every release. This guide covers the two source-control models, the tools, the challenges, and the controls to add. It builds on our guides to the delivery pipeline, DevOps metrics and continuous compliance in DevOps.
Why do database changes slow DevOps down?
Traditionally, developers write SQL, and a database administrator (DBA) reviews it shortly before production. By then a rework is costly. Shifting that review left and automating the routine steps makes releases more even. Automation is only part of the answer, because the real difficulty with databases is state: a change on a large table can take time and block inserts, updates and deletes while it runs.
DORA describes two habits that fix this. The cultural one is to talk to the people who run production databases early and give everyone visibility of pending changes. The technical one is to treat all schema changes as migrations, tracked per database instance and applied automatically.
What are the principles of Database DevOps?
| Principle | What it means for the database | Typical control |
|---|---|---|
| Source control | Schema, indexes, views, stored procedures, functions, triggers, configuration and business-logic lookup data are all stored in the repository. | Pull request review; the shared database is changed only by the build server. |
| Automated testing | Each change is tested against its requirements before it reaches a shared environment. | Tests run in the pipeline on a disposable copy of the database. |
| Repeatable deployment | Small changes go through the same process in every environment. | One pipeline for development, test and production. |
| Continuous delivery | Changes are promoted automatically after tests pass, so hot fixes are no longer made directly in production. | Approval gate for production; deployment record kept. |
Schemaless and NoSQL stores are not exempt. Collections, indexes, validation rules and database configuration still need to be versioned, even when the data model is flexible.

How should you source control a database: whole schema or change scripts?
There are two models, and the choice shapes your tooling.
Whole-schema (state-based) source control
The repository holds the database as you want it to look. Microsoft describes SQL Server Data Tools (SSDT) as bringing a declarative model, SQL database projects, into Visual Studio, with version control for all project files and CI/CD support through the SqlPackage command line. Tooling compares the target database with the desired state and works out the changes. It reads well and catches broken references at build time, but generated scripts for large structural changes can be inefficient, and an administrator may need to edit them by hand.
Change-script (migration-based) source control
The repository holds the ordered steps that build the database. Liquibase defines a changelog as a text file listing, in order, every change made to the database, and a changeset as a single unit of change within it, identified by its id and author. It tracks applied changes in a DATABASECHANGELOG table. Flyway works the same way: versioned migrations are applied in order, repeatable migrations re-run when their content changes, and a schema history table records what has been applied. Entity Framework Core migrations also generate migration files from model changes, store them in source control and record applied migrations in a history table.
The trade-off is control against readability. You decide exactly how a complex change runs, such as splitting or merging tables, but to see a table's current shape you must read every script that touched it.
Which database automation tools fit which job?
| Tool | Role | When it fits |
|---|---|---|
| Liquibase | Change-script migrations with a changelog and tracking tables. | Many database engines, audit trail of who changed what. |
| Flyway (Redgate) | Versioned and repeatable SQL migrations with a schema history table. | SQL-first teams that want simple, ordered migrations. |
| SSDT / SQL projects | Declarative, state-based projects for SQL Server and Azure SQL. | Microsoft-stack estates deploying through SqlPackage. |
| Entity Framework Core migrations | Application-model-driven migrations. | .NET applications that own their schema. |
| Jenkins, TeamCity | Pipeline servers that run the build, test and deploy steps. | Orchestrating any of the tools above. |
| DBmaestro, Delphix | Commercial database DevOps and data delivery platforms. | Check each vendor's own site for current scope before shortlisting. |
For pipeline design, see our guide to DevOps assembly lines and the wider enterprise DevOps operating model.
What are the challenges of Database DevOps and how do you handle them?
| Challenge | Why it happens | What to do |
|---|---|---|
| Tightly coupled architecture | Many applications connect directly to one shared database. | Move towards services that talk through defined interfaces, so each owns its schema. |
| Culture and late review | The DBA sees the change only before production. | Involve DBAs at design time; give them visibility of pending changes. |
| Persisting data during upgrades | Unlike application code, the database cannot simply be dropped and replaced. | Use the parallel change (expand and contract) pattern; test on production-like data scrubbed of sensitive information. |
| Static and test data | Some tables must be pre-stocked for the application to run. | Keep reference data in source control and load it through the same pipeline. |
| Database drift | Production is changed outside the pipeline, so environments diverge. | Allow changes only through the pipeline; compare environments on a schedule and alert on differences. |
DORA lists the parallel change (expand and contract) pattern, online schema migration tools, data partitioning and archiving among the approaches to zero-downtime changes, and warns that siloed DBA teams and shared schemas can block progress.
How do you govern database changes in an AI-assisted pipeline?
Teams increasingly use AI assistants to draft migration scripts and queries. The 2025 DORA State of AI-assisted Software Development report describes AI as an amplifier of an organisation's existing strengths and weaknesses, so a weak database change process will fail faster, not slower. Treat AI-drafted SQL like any other change: it enters the repository, passes the same tests and review, and reaches production through the same approval gate.
Compliance evidence follows from the pipeline: the changelog, the review and the deployment record show who changed what and when. We cover this in continuous compliance in DevOps. Where autonomous agents act on data, Elixir Govern (formerly AgentGRC) describes keeping agent actions inside policy with the audit trail risk teams need, and ElixirData Context OS describes keeping governed context, versioned policy and decision traces in one decision layer above AI agents.
How do you measure Database DevOps?
DORA suggests measuring the share of failed changes that are caused by database work and aiming for 100 percent of database changes to be automated. Add these to your DevOps metrics: change lead time and change fail rate for database changes, rollback or rework rate, and the number of manual production changes detected by drift checks. For the reliability side, see SRE vs DevOps.
What is a sensible adoption sequence?
| Step | Action | Done when |
|---|---|---|
| 1 | Put schema, indexes and reference data in source control. | A new environment can be built from the repository alone. |
| 2 | Choose state-based or migration-based control per database. | Decision recorded for each database. |
| 3 | Add automated tests and a build that applies changes to a disposable database. | Every pull request produces a pass or fail. |
| 4 | Block manual production changes; deploy only through the pipeline. | Drift checks report no unexplained differences. |
| 5 | Add approval gates, rollback plans and audit records. | Production changes are traceable end to end. |
| 6 | Track database share of failed changes and lead time. | Reviewed alongside the delivery metrics monthly. |
Do not start with tooling alone. If the database is small, changes are rare and one team owns both application and schema, a simple migration tool and a review rule are enough. Heavy platforms pay off when many teams change shared data stores. For current delivery trends see DevOps trends; for the underlying concept of data stores see what is a database.
If your team wants help with delivery for data platforms, see our DevOps consulting services.
To map one database change decision your agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.
FAQ
What is Database DevOps?
Database DevOps applies source control, automated testing, repeatable deployment and continuous delivery to database changes, in the same pipeline as application code.
Should I use state-based or migration-based source control?
State-based tools such as SSDT keep the desired schema in the repository and work out changes. Migration-based tools such as Liquibase and Flyway keep ordered change steps, which gives more control over complex changes but is harder to read.
How do I avoid downtime when changing a live database?
DORA lists the parallel change (expand and contract) pattern, online schema migration tools and data partitioning among the approaches, and advises testing on production-like data scrubbed of sensitive information.
What is database drift?
Drift is when production differs from the version-controlled source because changes were made outside the pipeline. Allow changes only through the pipeline and compare environments regularly.
What should I measure?
DORA suggests measuring the share of failed changes caused by database work and aiming for all database changes to be automated.
Follow XenonStack on LinkedIn: XenonStack on LinkedIn for new guides on agentic AI, data and platform engineering.
Ready to put AI agents to work? Explore ElixirClaw, the agentic OS platform to build, orchestrate and govern AI agents.
Explore the XenonStack platform family: ElixirData · ElixirClaw · ElixirHub · NexaStack · MetaSecure · Neural AI · AgentGRC · AgentSRE · AgentAnalyst · AgentInstruct · AgentRAI · AgentScrum · AgentSearch · AgentForce · AI Aviator · SAIF Aviator · CohortIQ · XenonStack AI · XenonStack UAE