BlogData Engineering

DataOps: Applying DevOps Principles to Data Engineering

James Okafor
James Okafor
Data & Cloud Engineer
·July 19, 202610 min read

DataOps applies DevOps practices — version control, CI/CD, automated testing, observability — to data pipelines. This guide covers what DataOps means in practice, the tools that implement it, and why it matters for data team reliability.

DataOps applies DevOps principles to data engineering: version control for data code, CI/CD pipelines for data deployments, automated testing before data reaches production, observability for pipeline health, and agile development practices for data teams. This guide covers what DataOps means in practice, the tooling that implements it, and why it matters for data team reliability.

The problem DataOps solves

Traditional data engineering operates like software development did before DevOps: code is written locally, deployed manually, tested informally, and monitored by watching dashboards for bad numbers. When a pipeline breaks, the first signal is often a business user asking why the dashboard is wrong. When a transformation change introduces a regression, it is discovered weeks later in a board meeting.

DevOps solved the same problem for application development: automated testing means regressions are caught before deployment; CI/CD means deployment is reproducible and reviewable; observability means failures are detected by engineers before users notice. DataOps applies the same disciplines to data pipelines.

Version control for data code

All data artifacts — SQL queries, dbt models, Airflow DAGs, Terraform configurations, schema definitions, data quality tests — belong in version control. This is the first and most important DataOps practice.

Version control enables: pull request review before deployment (a second set of eyes on every data transformation change), audit history (who changed which calculation, when, and why — in the commit message), rollback (reverting a bad transformation to the previous version), and branching (developing new features without touching production code).

In practice: a git monorepo containing the dbt project, Airflow DAGs, and Terraform configurations is the most common pattern. Some organisations separate the Airflow repo from the dbt repo, but co-locating them simplifies dependency management.

CI/CD for data pipelines

Continuous integration (CI) runs automated checks on every pull request. For a dbt project, this means:

1. Running dbt compile (confirms all SQL is valid)

2. Running dbt test against a development environment (confirms data quality tests pass for the changed models)

3. Running data diff via Datafold or dbt's slim CI (comparing outputs between the current branch and main, flagging unexpected differences in row counts, metric values, or column statistics)

Continuous deployment (CD) applies merged changes to production. For dbt: merging to main triggers a dbt run in production. For Terraform: merging to main triggers a terraform apply with approval gates for destructive changes.

The tooling: GitHub Actions, GitLab CI, CircleCI, or dbt Cloud's built-in CI runner. dbt Cloud's CI integration is the most purpose-built for dbt — it creates a development environment per pull request and runs tests against it automatically.

Automated testing

Data quality testing is the most underinvested DataOps practice. Most data teams test application code but do not apply the same discipline to data transformations.

A comprehensive data testing strategy includes:

**Unit tests for transformations**: Validate that a specific transformation produces expected output for known input. In dbt, these are implemented as test models that assert on specific scenarios.

**Schema tests**: Confirm columns are not null, values are unique, foreign keys reference valid primary keys. dbt's built-in generic tests (not_null, unique, relationships, accepted_values) cover these. Zero-cost to implement; significant protection against data model errors.

**Custom data quality assertions**: Business rules that data must satisfy — order amounts are never negative, order_date is never in the future, customer counts are within 5% of the previous day. Great Expectations or dbt custom tests implement these.

**Statistical drift detection**: Alert when distributions of key metrics deviate significantly from historical norms. An order count that is 40% below the trailing 30-day average on a Tuesday is a signal of pipeline failure, not a business trend. Monte Carlo and Anomalo specialise in this; simpler implementations use custom monitoring queries in Airflow.

Observability

Observability for data pipelines means knowing the health of the pipeline without having to look at each individual job. The key signals:

**Freshness**: When was this table last updated? A table that should refresh every hour but has not updated in 6 hours is failing. dbt's source freshness checks and Airflow's task SLA monitoring track this.

**Volume**: Are the expected number of rows present? A fact table with 0 rows after a pipeline run indicates a failure upstream. Row count checks in dbt tests or Great Expectations catch this immediately.

**Schema changes**: Did a source system add, remove, or rename a column? Schema changes in upstream systems that are not handled break pipelines silently. Data contracts (formal schemas that producers commit to maintaining) and schema evolution handling in dbt catch this.

**Query performance**: Are pipeline queries taking longer than baseline? A 10x increase in query time is a signal of upstream data volume change, query plan regression, or warehouse capacity issue. Airflow task duration monitoring and warehouse query history track this.

The observability tools: Monte Carlo (data observability SaaS), Anomalo (ML-based anomaly detection), Datadog (infrastructure + data monitoring integration), or custom dashboards built from dbt test results and Airflow metadata.

Environments

DataOps requires multiple environments: development, staging, and production. Each environment has its own database schema or warehouse environment, with data that mirrors production at a smaller scale.

**Development**: Individual engineer environments, used for local development and testing. dbt Cloud provides a per-developer environment with a dev schema. Cost-controlled by limiting data to a sample.

**Staging (CI)**: Environment spun up per pull request for CI testing. dbt's slim CI creates a staging environment with only the models affected by the pull request's changes. Ephemeral — deleted after the CI run completes.

**Production**: The live environment that powers business analytics. Changes reach production only through the merge → CI → CD pipeline.

The pattern for dbt: use dbt's multi-environment configuration with separate targets (dev, staging, prod), schema customisation (write to dev_{username} in development, prod in production), and variables to control sample data in development.

Development workflow in a DataOps team

A DataOps-mature data team operates like a software engineering team:

1. Business request → create ticket in Jira/Linear with acceptance criteria

2. Engineer creates a branch → develops in a dev dbt environment

3. Opens pull request → CI runs automatically: compile, test, diff

4. Peer reviews the SQL changes and test results

5. Merges to main → CD deploys to production

6. Monitors production for anomalies via observability tooling

The cycle time from request to production is measured in days, not weeks. Regressions are caught in CI, not in production. The data team has visibility into pipeline health without waiting for business users to report problems.

For the tooling that underlies DataOps practice, see dbt best practices, apache airflow guide, and data quality framework. Our data architecture consulting practice helps data teams implement DataOps practices from version control through observability — book a free maturity assessment.

Get your data architecture audit in 30 minutes.

A former Microsoft data architect audits your data foundation, identifies your top priorities, and sends you a written plan. Free. No pitch.

Book a Call →