dbt · Incremental Models & Performance

Snapshots vs incremental models

Hardsnapshotsscdincrementalhistory

Interview question

What is the difference between dbt snapshots and incremental models?

How to answer

The short answer

Both deal with change over time, but they solve different problems.

Incremental models

Build an up-to-date analytics table efficiently. The end state is usually "current grain" (1 row per key, or append-only events), refreshed cheaply.

Snapshots

Capture how a source table changed historically ( style). dbt records dbt_valid_from / dbt_valid_to (and hash) so you can query what a row looked like at a past time.

Output
Incremental:  "efficiently maintain the latest fact/dim I need"
Snapshot:     "keep history of mutable source rows for as-of queries"

Snapshot sketch

SQL
{% snapshot customers_snapshot %}
{{ config(
    target_schema='snapshots',
    unique_key='customer_id',
    strategy='timestamp',
    updated_at='updated_at'
) }}
select * from {{ source('crm', 'customers') }}
{% endsnapshot %}

When to use which

  • Mutable source dimensions you must audit → snapshot
  • Large fact transforms you must refresh daily →
  • Sometimes: snapshot sources, then build incremental marts from snapshots

Interview tip: Do not call every incremental table a "snapshot." Snapshots are specifically dbt's SCD/history mechanism for source change tracking.