DevOps Tools for DBAs
The DBA's DevOps toolchain: planning, Git, CI/CD pipelines, Liquibase and Flyway, Terraform and Ansible, and monitoring.
The DBA's DevOps toolchain
DevOps tools fit together into a toolchain: work is planned in a tracker, changes are written as code in Git, tested and released by a pipeline, applied to infrastructure and databases by automation tools, and watched by monitoring. A DBA doesn't need to master every tool, but should know what each one does and where database work fits.
Planning and version control
- Jira, GitHub Issues, Azure Boards
- Where work is planned and tracked, as covered in Planning and Tracking Work.
- Git
- The version control system almost every team uses. Every SQL script, migration, Terraform file, Ansible playbook, and runbook goes into Git, so there's a full history of who changed what, when, and why, and any change can be reviewed before it's applied.
- GitHub, GitLab, Bitbucket, Azure Repos
- Hosted services for Git repositories, adding pull requests (or merge requests) for peer review, plus permissions and integration with pipelines. The Git for DBAs module covers them in depth.
CI/CD pipelines
A CI/CD tool runs a pipeline: a series of automated steps triggered by a change in Git, such as checking SQL, running tests against a temporary database, and deploying to each environment with approvals in between.
| Tool | Notes |
|---|---|
| GitHub Actions | Built into GitHub; pipelines are YAML files in the repository |
| GitLab CI/CD | Built into GitLab, with the same YAML approach |
| Jenkins | The long-standing open source automation server, common in large enterprises |
| Azure Pipelines | Part of Azure DevOps, popular in Microsoft-centered companies |
A small GitHub Actions pipeline that checks SQL style on every pull request looks like this:
# .github/workflows/sql-check.yml
name: Check SQL
on: pull_request
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip install sqlfluff
- run: sqlfluff lint migrations/ --dialect oracle
Database change management
Schema changes are the hardest part of database DevOps, because, unlike application code, a database can't simply be replaced: its data must be preserved. Migration tools solve this by keeping every change as a numbered, versioned script, and recording in the database which ones have been applied.
- Liquibase
- Changes are written as changesets, in SQL, XML, YAML, or JSON, listed in a changelog. Liquibase tracks applied changesets in a
DATABASECHANGELOGtable, supports rollbacks, and works with most databases, including Oracle, SQL Server, PostgreSQL, and MySQL. - Flyway
- Changes are plain SQL files named by version, such as
V3__add_order_index.sql, applied in order and recorded in aflyway_schema_historytable. Its simplicity makes it popular with developers.
-- migrations/V3__add_order_index.sql: applied once, in order, in every environment
CREATE INDEX orders_date_region_ix ON orders (order_date, region);
With a migration tool, the same scripts run in development, test, and production in the same order, so environments stay in step. The Database CI/CD module covers this in depth.
Infrastructure and configuration
- Terraform
- The most widely used infrastructure as code tool. You describe the infrastructure you want, such as a network, a database server, or an Autonomous Database, in files, and Terraform creates or changes it to match, on AWS, Azure, OCI, and many other platforms. Its open source fork is called OpenTofu.
- Ansible
- A configuration and automation tool that connects to servers over SSH and runs playbooks written in YAML. DBAs use it to install database software, apply patches, set parameters, create users, and run the same task on hundreds of servers at once.
- Cloud-native tools
- Each cloud's own IaC tool, such as AWS CloudFormation, Azure Bicep, and OCI Resource Manager, which runs Terraform.
- Containers
- Docker runs a database in a container in seconds, which is ideal for testing migrations in a pipeline. Kubernetes runs containers at scale, and some production databases run on it with operators that manage them.
Monitoring and observability
| Tool | What DBAs use it for |
|---|---|
| Prometheus | Collecting metrics from databases and servers through exporters, with alert rules |
| Grafana | Dashboards that combine metrics from many sources |
| Oracle Enterprise Manager, cloud monitoring | Database-specific monitoring and tuning, such as OEM, CloudWatch, Azure Monitor, and OCI Database Management |
| Datadog, New Relic, Dynatrace | Commercial observability platforms that link application and database performance |
| PagerDuty, Opsgenie | Routing alerts to whoever is on call, with escalation |
The Monitoring and Observability module covers these in depth.
Collaboration and security
- Confluence, wikis, and Markdown in Git for runbooks, designs, and decisions.
- Slack and Microsoft Teams for team chat, often with pipeline and alert notifications, sometimes called ChatOps.
- HashiCorp Vault and cloud secret managers for passwords and keys, so they're never stored in code.
- Code scanners, such as tools that find secrets in commits or insecure settings in Terraform, as part of DevSecOps.
Key takeaways
- The DevOps toolchain runs from plan, to code, test, release, provision, and operate, with feedback flowing back into the plan.
- Git holds everything: SQL, migrations, infrastructure code, playbooks, and runbooks. Pull requests add peer review.
- CI/CD tools such as GitHub Actions and Jenkins run pipelines that test and deploy every change.
- Liquibase and Flyway apply versioned schema changes the same way in every environment.
- Terraform builds infrastructure, Ansible configures servers and databases, and monitoring tools close the loop.