English · IndiaLog in
Rackwave Technologies
Request quote Free consultation
DataUpdated 26 Nov 2026

dbt Snapshots: Tracking Data History With SCD Type 2

dbt snapshots: SCD type 2 history, strategies, setup and point-in-time joins.

Written by Rohan Verma
  • Published25 Nov 2026
  • Read time6 min
  • Length1,274 words
Share this guide

What are dbt snapshots? dbt snapshots record how rows in a mutable table change over time, so you can answer questions about what a record looked like in the past. Many source tables simply overwrite old values, so an address, a plan or a status change erases history. A snapshot compares each run with the previous state and keeps a row for each version, with start and end timestamps, which is the pattern known as a type 2 slowly changing dimension. This guide explains how snapshots work, the timestamp and check strategies, how to configure and query them, how to use them in models and reports, how to handle deletes and the mistakes that lose history or create confusing duplicates. Details vary by version and adapter, so confirm in current dbt documentation.

Short answer: Use snapshots for source tables that overwrite data you need to keep. Pick a unique key and either an updated-at column or a column check, run snapshots on a schedule and build current and historical views on top.

Why history matters

Business questions often depend on the past: which plan was a customer on when they bought, who owned an account last quarter or what price applied on a given day. If the source only stores the latest value, that history is gone unless you capture it. Snapshots preserve it at the pace you run them. See data modeling and data warehouses.

dbt snapshots diagram
Figure 1. dbt snapshots: source row, snapshot, valid range and how they relate.

How a snapshot records change

ColumnMeaning
Business key and attributesCopied from the source row
dbt_valid_fromWhen this version became current
dbt_valid_toWhen it was replaced, empty for the current version
dbt_scd_idUnique identifier for each version
dbt_updated_atThe timestamp used to detect change

Each change creates a new row and closes the previous one, so the full history of a record is a series of rows.

Snapshot strategies

StrategyHow it detects changeBest forLimitation
TimestampCompares an updated-at columnSources with a reliable updated-atFails if the column is not maintained
CheckCompares chosen columns or all columnsSources without a timestampHigher compute and may miss unlisted columns

Prefer the timestamp strategy where possible. See sources and seeds for choosing reliable inputs.

Snapshots at a glance summary
Figure 2. Snapshots at a glance: history, strategy, use at a glance.

Setting up a snapshot

  1. Pick the source. Choose a table that overwrites values you need to keep.
  2. Define the unique key. Identify the row, such as customer id.
  3. Choose the strategy. Timestamp where available, otherwise check columns.
  4. Set the target schema. Place snapshots in a protected, separate schema.
  5. Run on a schedule. Run often enough to catch changes you care about.
  6. Build views on top. Expose current and as-of views for analysts.

Using snapshot data

  • Filter on a null valid-to date to get the current version of each record.
  • Join facts to the version valid at the event time for point-in-time accuracy.
  • Build dimension models from snapshots for history-aware reporting.
  • Count changes to understand how often attributes move.
  • Expose clean current and historical views, not raw snapshot tables.
  • Document the run frequency so users know the resolution of history.

Operating snapshots safely

Snapshots hold history that cannot be recreated, so protect them. Place them in a separate schema with restricted write access, back them up and avoid dropping or fully refreshing them. Do not change the unique key or strategy casually, because that can corrupt the history. Plan changes carefully and test on a copy first.

  • Separate, protected schema.
  • Backups and restricted access.
  • Careful, tested changes to configuration.
  • Monitoring for unexpected row growth.

Snapshots compared with other history approaches

Snapshots are one of several ways to keep history. Change data capture records every change as it happens and gives complete detail, but needs source and platform support. Source-system audit tables keep history inside the application, but they are rarely modelled for analytics. Append-only event tables suit data that is naturally event-based.

Snapshots shine when you cannot change the source and only need history at the resolution of your schedule. Choose based on how precise the history must be, how large the table is and how much you control the source system.

  • Use change data capture for complete, precise history.
  • Use snapshots when you cannot change the source.
  • Use event tables for naturally event-based data.
  • Match the resolution to business needs.

Governance of historical data

History can contain personal data that people have asked to delete. Plan for privacy requests by recording where personal fields live in snapshots, defining a deletion or anonymisation process and keeping access limited to those with a need. Document retention periods, and remove history that is no longer required. See data governance.

  • Record where personal data lives.
  • Define deletion and anonymisation steps.
  • Set retention periods.

Testing snapshots

Test that the key is unique within each valid period, that valid-from dates never overlap for the same key and that exactly one current row exists per key. These checks catch configuration mistakes early, before they damage history that cannot be rebuilt.

  • Exactly one current row per key.
  • No overlapping validity ranges.
  • Valid-from before valid-to.

Common mistakes

  • Snapshotting a table that already stores full history.
  • Choosing an updated-at column that is not reliably maintained.
  • Running snapshots too rarely and missing short-lived changes.
  • Allowing full refresh or drops on snapshot tables.
  • Not exposing a simple current view, so analysts use raw rows.
  • Ignoring deleted source rows.

A worked example

A subscription business snapshotted its customer table, keyed on customer id with the updated-at timestamp, running every hour. A dimension model joined each order to the customer version valid at purchase time.

Revenue by plan became accurate even for customers who later changed plans, and support could see exactly when an account owner changed. The example is illustrative.

Best practices and support

  • Snapshot only what you need.
  • Run on a regular, documented schedule.
  • Test keys and valid-from ordering.
  • Expose simple views for users.

Our data warehousing service and data governance service design history-aware models and protect critical data.

Read dbt models, incremental models, data governance and master data management for related topics.

Snapshot checklist

ItemDone when
KeyUnique and tested
StrategyTimestamp or check chosen deliberately
ScheduleMatches how fast data changes
AccessProtected schema
ViewsCurrent and as-of views available
DeletesBehaviour documented

Handling deletes and hard changes

When a row disappears from the source, a snapshot can mark it as invalidated, keeping history while showing it is no longer current. Decide how your reports should treat deleted records and document it. For very large tables or when the source supports change data capture, a capture stream may be a better way to record history than snapshots alone. See change data capture.

  • Enable invalidation for deleted rows.
  • Document report treatment of deletes.
  • Consider change data capture for large tables.
  • Test with sample deletions.

Point-in-time joins in practice

To report facts as they were, join on the business key and require the event time to fall between the valid-from and valid-to values of the snapshot row. Treat an empty valid-to as the far future. Test these joins carefully with known examples, because mistakes produce duplicated or missing facts that are hard to spot.

Key takeaways

  • Snapshots keep history of changing rows.
  • Timestamp strategy is preferred.
  • Run often enough to catch changes.
  • Protect snapshot tables.
  • Expose current and as-of views.

Quick glossary

TermMeaning
SnapshotRecorded history of a changing table
SCD type 2New row for each change
Valid from and toVersion time range
Point-in-time joinJoin using version valid at event time
InvalidationClosing history for deleted rows

Read next: BigQuery vs Snowflake: Which Cloud Data Platform? · BigQuery Streaming Inserts: Real-Time Ingestion Guide · BigQuery Access Control: IAM, Policy Tags and Row Security

Frequently asked questions

What is a dbt snapshot?

A table that records how rows in a source change over time, keeping a row per version.

What is a type 2 slowly changing dimension?

A design that keeps history by adding a new row each time an attribute changes.

Timestamp or check strategy?

Use timestamp when a reliable updated-at column exists, and check when it does not.

How do I get the current version of a record?

Filter on rows where the valid-to date is empty.

How often should I run snapshots?

Often enough to capture changes you need, as shorter-lived changes between runs are missed.

Can snapshots be rebuilt?

Not from the source, because history is lost, so protect and back them up.

How are deleted rows handled?

Snapshots can invalidate rows that vanish from the source, keeping their history.

Where should snapshots live?

In a separate, protected schema with restricted write access.

Was this guide helpful?Your answer helps us decide what to improve. It is not linked to you.

#dbt snapshots#dbt slowly changing dimensions#dbt snapshot strategy#dbt type 2 history#dbt valid from valid to

About the author

Rohan Verma

Data Platforms Consultant

Rohan works across CDP, data warehouse, and analytics platform implementations, helping clients figure out which data infrastructure actually fits their scale rather than defaulting to whatever's currently trending.

Data Platforms & Technical Architecture

Ready to put AI and data to work?

Book a free consultation and leave with a plan, not a pitch.

Get a free consultationRequest quote