Introduction

SCDs are techniques used in dimensional modeling to manage and track changes in dimension table attributes over time. This article explores different SCD types, real-world examples, and best practices for implementation.

💡 What is a Slowly Changing Dimension?

A Slowly Changing Dimension refers to a dimension that changes slowly over time, rather than on a regular schedule. Common examples:

These changes must be handled in a way that supports both historical analysis and current reporting.

Types of Slowly Changing Dimensions

🔹 SCD Type 0: Fixed Dimension

🔹 SCD Type 1: Overwrite

🔹 SCD Type 2: Add New Row (with history)

🔹 SCD Type 3: Add New Column

SCD Type Name Tracks History? How it Works When to Use Example
0 Fixed Dimension ❌ No No changes are allowed to the attribute Values that never change Product launch date
1 Overwrite ❌ No Overwrites the old value with the new one Corrections or non-historical fields Fixing a misspelled customer name
2 Add New Row ✅ Full history Inserts a new row with updated values and a new surrogate key Changes that need full tracking over time The customer moves to a new city
3 Add New Column ✅ Partial Adds a new column to retain the previous value When only one previous value needs to be stored Store both the current and previous region for the customer

Real-World Example: Customer Dimension

Let’s say a customer changes their city from Colombo to Kandy:

Type 1

Type 2

Type 3

📊 BI Tip: Which SCD Type Should You Use?

In practice, many systems use Type 2 combined with Type 1 fields.

Conclusion

SCDs are essential for designing accurate and insightful data warehouses. They ensure that your data reflects both the present and the past, enabling deeper business analysis.

In the next article, we will walk through the ETL design pattern to implement SCD Type 2 with SQL or tools like SSIS or dbt.