dbt Snapshots vs SCD: A Guide to Choosing the Right Method

13 minutes to read
Get free consultation

 

Managing historical data in dbt often requires analytics engineers to choose: take the simplicity of dbt’s built-in snapshots, or the flexibility of custom slowly changing dimensions (SCDs). Making the right call directly affects your warehouse cost, compliance posture, technical debt, and your ability to respond quickly to analytics requests.

This guide breaks down the difference, weighing the performance and cost trade-offs of dbt snapshots vs SCD logic. Drawing on our direct experience advising analytics engineering teams, you’ll get a concrete framework for selecting the best approach for managing historical data dbt—with practical context for regulated industries, audit trails, and analytics speed.

The Strategic Trade-Off: Simplicity vs. Granularity in Historical Data

Managing historical data is not just technical—it’s a business-critical decision. For regulated industries (like finance or healthcare), legal compliance and audit trails are mandatory. But, if building an audit-compliant model balloons storage costs and workloads, it can undermine platform efficiency.

A common client question: “How can I track changes in my dimension tables without driving up warehouse costs or burdening the team with technical debt?”

dbt snapshots were built for speed and reusability, giving you SCD Type 2 tracking automatically. However, as your data grows or business rules get sophisticated, hand-coded SCD logic can offer the control you need. The choice hinges on the classic trade-off between simplicity and granularity.

What Are dbt Snapshots? The Declarative Approach to Capturing History

dbt snapshots are a core part of dbt for managing historical changes. With just a few lines of configuration in your snapshots directory, you get SCD Type 2 “out of the box”: each change to a tracked record preserves an older version. This makes dbt snapshots ideal for audit-ready tables or any use case requiring change data capture with full history—especially fast for analytics engineers new to SCD patterns.

Unlike manual approaches, dbt snapshots rely on automated change detection algorithms and can easily be enabled across multiple tables, letting teams achieve consistency and compliance with minimal custom SQL.

Want a full blueprint for organizing large dbt projects? See our dbt Project Structure Conventions for practical tips and best practices.

How Snapshots Work: timestamp vs. check Strategies

For capturing changes, dbt snapshots offer two strategies:

The choice is significant: the timestamp strategy may miss changes when timestamps aren’t dependable, while check can increase compute costs by scanning more data, especially for very wide or high-frequency tables. Both are supported officially (dbt docs). For a walkthrough, see phData’s guide.

Pros: When to Use Snapshots for Speed, Simplicity, and Compliance

dbt snapshots shine in certain scenarios:

dbt snapshots are especially suited to use cases with moderate data size, a need for every change captured, or early-stage analytics teams.

Cons: The Downsides of Potential Costs and Lack of Flexibility

But snapshots have real trade-offs:

If controlling storage cost or implementing nuanced compliance rules is required, teams often reach for custom SCD logic.

What Are Custom SCDs? The Path to Granular Control and Performance

Custom slowly changing dimensions (SCDs) refer to hand-crafted dbt models—usually incremental models—that track historical changes using your own SQL logic. Supported by every major cloud data warehouse, these allow for SCD Type 1, 2, 3, or even hybrid solutions, and leverage features like history tables, surrogate keys, and business-driven partitioning.

This approach benefits teams that need strict cost control, retention rules, or multi-attribute tracking that snapshots can’t easily support (see Kimball Group guidance).

Implementing SCD Type 2 with Incremental Models & Surrogate Keys

When custom SCD Type 2 is necessary, the core techniques include:

Teams can fine-tune these rules for GDPR deletion, regulatory hold-outs, or attribute-specific tracking, aligning with legal requirements and business policy.

Pros: When to Use Custom SCDs for Total Control and Optimization

Custom SCD models are most powerful when:

Cons: The Hidden Costs of Code Complexity and Maintenance Overhead

Downsides to model-based SCDs include:

Snapshots are often preferred for teams early in their analytics journey or where engineering bandwidth is limited.

https://stellans.io/wp-content/uploads/2025/10/pexels-googledeepmind-17485633-1.jpg

Decision Framework: A Side-by-Side Comparison

Use this decision matrix to match your data scenario to the right method. This structure is drawn from direct client engagements and applies to most analytics engineering teams.

Criteria dbt Snapshots Custom SCDs
Setup Speed Very fast, declarative Moderate, custom SQL
Maintenance Low Medium to high
Performance Tuning Limited Highly flexible
Supported SCD Types Type 2 only Types 1, 2, 3, hybrid
Warehouse Cost May increase with scale Can be tightly controlled
Change Detection Timestamp/Check Fully bespoke
Use Case Fit Audit, prototyping Complex, high-volume

For a deeper dive into designing a scalable dbt project, our advisory team can help tailor the best approach as your needs evolve.

https://stellans.io/wp-content/uploads/2025/10/pexels-googledeepmind-17485632-1.jpg

Real-World Scenario: Tracking Product Price Changes

Let’s ground the trade-offs with a real client scenario: “Show me how our product prices have changed over time—for analytics, audit, and pricing agility.”

Requirements:

Solution 1: The dbt Snapshot Implementation (With Code)

For most moderate data volumes, dbt snapshots provide a simple solution. Here’s a minimum working example for tracking product_price changes with the check strategy:

-- snapshots/product_price_snapshot.sql
snapshot: product_price_snapshot

  target_schema: analytics
  target_database: your_database

  unique_key: id

  strategy: check
  check_cols: ['price', 'currency']
  updated_at: updated_at

  sql: |
    select id, price, currency, updated_at from {{ ref('stg_product_price') }}

Refer to the official dbt snapshots documentation for deeper technical detail.

Solution 2: The Custom SCD Implementation (With Code)

For large catalogs or specific business rules (such as limited retention or attribute-based change logic), a custom incremental model is best:

-- models/dim_product_price_history.sql
{{ config(
    materialized='incremental',
    unique_key='product_price_sk',
    on_schema_change='append_new_columns')
}}

with source as (
    select * from {{ ref('stg_product_price') }}
),
latest as (
    select * from {{ this }} where is_current = true
),
joined as (
    select
        s.id as product_id,
        s.price,
        s.currency,
        case when l.price <> s.price or l.currency <> s.currency then 1 else 0 end as is_new_version
    from source s
    left join latest l on s.id = l.product_id
)
select
    md5(cast(product_id as varchar) || cast(price as varchar) || cast(currency as varchar) || current_timestamp) as product_price_sk,
    product_id,
    price,
    currency,
    current_timestamp as valid_from,
    null as valid_to,
    true as is_current
from joined
where is_new_version = 1

For the best practice design patterns, review Kimball’s SCD Tips.

Conclusion: Making a Scalable Choice for Your Data Model

For analytics engineering teams, the choice of dbt snapshots vs SCD logic is strategic—not merely technical. Snapshots deliver unmatched speed, compliance, and simplicity for SCD Type 2 scenarios, especially with manageable data footprints and general audit requirements. Custom SCDs, built on dbt incremental models, are the power tool for complex, large-scale, or regulated environments requiring fine-tuned retention, cost control, and business-specific rules.

Use our comparison framework to guide your approach. If your team is designing for scale or facing compliance/warehouse cost challenges, Stellans’ Data Modeling Advisory can help you build a compliant, cost-efficient, and scalable approach to managing historical data dbt.

Frequently Asked Questions

What is the difference between dbt snapshots and slowly changing dimensions (SCD)?

dbt snapshots are a built-in dbt feature that automates SCD Type 2 tracking, capturing every row-level change in a dimension table. Slowly Changing Dimensions is a core data warehousing concept describing several types (Type 1, 2, 3, etc.) of tracking data history, which can be implemented using either dbt snapshots or custom SQL/dbt incremental models. Read more on Wikipedia.

When should I use dbt snapshots vs. implementing SCD logic manually?

Use dbt snapshots for simplicity, audit readiness, and manageable data volumes. Choose custom SCD logic when you need full control, multiple SCD types, selective retention, or to finely optimize warehouse costs and performance for high-volume tables. Performance and compliance requirements are the deciding factors.

What is the best strategy for detecting changes in dbt snapshots: timestamp vs check?

The check strategy is most accurate as it compares specified columns for substantive changes, even when timestamps are unreliable. The timestamp strategy is faster, but only reliable if your source system updates timestamps strictly for real changes. See dbt docs for details.

Need Help Choosing or Implementing Historical Tracking for dbt?

If your team is weighing dbt snapshots vs SCD options, or needs an approach that aligns business, cost, and compliance for managing historical data dbt, our Data Modeling Advisory provides expert, hands-on support. Build a model that’s compliant, cost-efficient, and ready to scale.

Article By:

https://stellans.io/wp-content/uploads/2024/06/telegram-cloud-photo-size-2-5364116417437360081-y-1-1.png
Roman Sterjanov

Data Analyst at Stellans

Related Posts

    Get a Free Data Audit

    * You can attach up to 3 files, each up to 3MB, in doc, docx, pdf, ppt, or pptx format.