📘 Introduction

Incremental models are one of the most important dbt concepts for growing datasets. Instead of rebuilding a full table on every run, an incremental model only processes the new or changed rows that match your filter.

In this tutorial, you will learn dbt incremental models with a practical example. We will use enrollment_cleaned, an event-style `02_silver` model that feeds a Gold fact table. Enrollment data grows over time, so it is a strong candidate for incremental processing.

We will follow the Medallion Architecture convention used in this blog: Bronze contains raw source definitions in sources.yml, Silver contains cleaned dbt models, and Gold contains business-ready dim and fact tables.

💡 What is an incremental model?

A normal dbt table model rebuilds the full table when you run it. That can be fine for small datasets, but it becomes expensive when the table grows.

An incremental model is different. The first run builds the full table. Later runs only process rows that are new or updated, based on a condition you define with is_incremental().

This is especially useful for event-style data such as enrollments, orders, transactions, clicks, logs, or API events.

🧭 What are we implementing?

We will create an incremental `02_silver` model named enrollment_cleaned. It reads raw enrollment data from a source table, cleans a few fields, and only processes rows whose updated_at timestamp is newer than the latest row already loaded into the model.

sources.yml schema 01_bronze -> 02_silver enrollment_cleaned -> 03_gold fact_enrollment

The grain of enrollment_cleaned is one row per enrollment_id. That is why we will use enrollment_id as the unique_key.

✅ Prerequisites

☑️ A working dbt project
☑️ Raw enrollment data already loaded into your data warehouse or local database
☑️ The raw enrollment source table already defined in models/sources.yml
☑️ Basic SQL knowledge
☑️ A data warehouse or local database adapter already configured for dbt

🗂️ Current project structure

Before creating the incremental model, the relevant project structure excerpt looks like this:

💡
This is only the relevant excerpt of the dbt project structure. Bronze contains source definitions in sources.yml, not dbt SQL models. dbt models start in the `02_silver` folder.
models/
└── sources.yml

🎓 Want to go deeper with dbt?

If you want to understand incremental models, Medallion Architecture, and dbt project structure in more detail, the Academy and the dbt book go deeper into hands-on dbt projects with practical examples.

CTA Image

If you’d like to dive deeper into dbt (data build tool), our book Building Modern Data Pipelines with dbt: From Raw Data to Gold Standard with the Medallion Architecture provides a hands-on guide to designing modern data pipelines. It covers dbt’s core concepts and best practices, including building Bronze, Silver, and Gold layers with the Medallion Architecture. It also serves as a hands-on study guide for the dbt Analytics Engineering Certification.

View on Amazon

You can view this post with the tier: Academy Membership

Join academy now to read the post and get access to the full library of premium posts for academy members only.

Join Academy Already have an account? Sign In