Home › Key concepts › Slowly changing dimensions
Key concept · Walk (intermediate) · the same on every platform
Slowly changing dimensions
How to record that a customer moved city, without rewriting history.
What it is
Descriptions change over time. Type 1 overwrites the old value, so history shows the new one. Type 2 adds a new row with valid-from and valid-to dates, so last year's sales stay with last year's city.
See it happen: Problem Lab: SCD Type 2 pitfalls, the naive fix and the right one (simulation), recorded from a real run.
Why it matters
Without it, moving one customer quietly changes last year's regional sales report.
An example
Asha moves from Pune to Sydney: her old row is closed on 15 Nov, a new Sydney row opens, and past orders still count for Pune.
The common mistake
Using Type 1 everywhere, then being asked why last year's numbers changed.
Where you meet it on each platform
The idea stays the same; only the product name changes.
| Job | AWS | Azure | Google Cloud | Databricks | Open source |
|---|---|---|---|---|---|
| SQL modellingturn raw tables into clean, tested, documented ones | dbt on Redshift or Athena | dbt on Fabric | Dataform or dbt on BigQuery | Lakeflow Declarative Pipelines or dbt | dbt with DuckDB |
Related ideas
Where it shows up
Part of the Walk level on these paths: Data Engineering (shaping data).