Glossary Entry

What is CI/CD for Data?

CI/CD for data applies automated testing and deployment to data pipelines and SQL. See how dbt tests and Nessie branches validate changes before release.

Written by Alex Merced

What is CI/CD for Data?

Introduction to CI/CD

In traditional software engineering, developers used to write code for six months, merge it all together in one large batch, and deploy it to production at 2:00 AM on a Sunday. It often caused failures because many untested code changes conflicted with each other.

The software industry solved this with CI/CD (Continuous Integration / Continuous Deployment). Instead of large 6-month releases, developers merge small chunks of code every day. When they push code to GitHub, an automated server (like GitHub Actions or Jenkins) starts a job, compiles the code, runs the automated tests, and if all tests pass, automatically deploys the code to the live production server.

This automation allows large technology companies to deploy code to production many times a day.

The Crisis in Data Engineering

While Software Engineers adopted CI/CD years ago, Data Engineers lagged behind.

Until recently, if a Data Analyst wanted to change the formula for “Gross Revenue” in a SQL view, they would log directly into the production Snowflake or Redshift database and run CREATE OR REPLACE VIEW. If they made a typo in the math, the dashboard used by the CEO the next morning would display incorrect financial numbers. There was no testing, no version control, and no safety net.

Implementing CI/CD for Data (DataOps)

To bring the rigor of software engineering to the data warehouse, the industry developed DataOps, using tools like dbt (Data Build Tool) and Git-like catalogs (like Project Nessie).

A CI/CD pipeline for Data Engineering works much like a software pipeline:

1. Branching and Isolation

A Data Engineer does not edit code in Production. They create a Git branch (e.g., feature/update-revenue-math). If they are using a modern data catalog like Nessie (which provides Git-for-Data), they can also create a branch of the actual data at the catalog level, which copies metadata pointers rather than data files. They can experiment on the data without affecting production dashboards.

2. Continuous Integration (Automated Testing)

The engineer finishes updating the SQL code in dbt and opens a Pull Request on GitHub. The CI/CD server starts a job. It reads the new SQL code. It spins up a temporary database schema and runs the code. It then executes Automated Data Tests:

  • Test 1: Ensure Gross_Revenue is never a negative number.
  • Test 2: Ensure the User_ID column contains no NULL values.
  • Test 3: Ensure row counts match the source data.

3. Continuous Deployment

If Test 1 fails, the CI/CD server blocks the Pull Request with a red “X”. The bad code does not reach production. If all tests pass, a Senior Data Engineer reviews the code and clicks “Merge.” The CI/CD server automatically executes the final dbt job, updating the production views and tables.

Conclusion

CI/CD for Data is the shift from “Hope-Driven Development” to tested, repeatable Data Quality. By sending analytical SQL code through version control and automated data testing, data teams can deploy pipeline updates frequently with confidence and keep business users’ trust in the enterprise dashboard.

Learn More

To learn more about the Data Lakehouse, read The Lakehouse Built for Everyone by Alex Merced. You can find this and other books by Alex Merced at books.alexmerced.com.

Work with Alex