Slowly Changing Dimensions (SCD) Explained
Slowly changing dimensions are what every data engineer eventually runs into: the moment you realize your dimension table only stores today’s values and someone is asking about the past. Understanding SCD types comes down to one design decision you make every time a dimension attribute changes. In this guide What a slowly changing dimension is The core problem: overwrite or keep history? SCD Type 1: overwrite the old value SCD Type 2: add a new row with validity dates SCD Type 3: add a column for the previous value Type 1 vs 2 vs 3 side by side How to implement it (and common pitfalls) FAQ Quick answer: A slowly changing dimension is any dimension attribute that drifts over time — customer city, product category, sales region. Type 1 overwrites in place (no history). Type 2 adds a new row with validity dates — the workhorse. Type 3 adds a previous-value column (one transition only). Most teams need Type 2 more than they expec...