internalsGet Pro

Module 15 · Lesson 8 of 12Pro

dbt snapshots for slowly changing data

Level
Intermediate
Topic
Transformations with dbt
Reading time
17 min

When you finish this page you can

  1. Define a dbt snapshot in YAML and say what each run does to its rows.
  2. Choose between the timestamp and check strategies, and set hard deletes and the open end of each range before the first run.
  3. Build a type 2 dimension with stable surrogate keys and -1 and -2 rows from a snapshot.
  4. Decide how often a snapshot must run and where it sits in a nightly pipeline.
  1. Slowly changing dimensions: types 1, 2 and 317 min
  2. Materializations: views, tables and incremental models18 min
  3. Design: orchestrating a daily reporting pipeline28 min

1.8 million customers moved without moving

At 07:40 IST on Wednesday 16 February 2028, Meera opens the nightly row counts. dim_customer grew by about 1.8 million rows overnight. A normal night adds a few thousand.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan