Back to articles
Slowly Changing Dimensions: Types 1-3 with Examples
How-To

Slowly Changing Dimensions: Types 1-3 with Examples

via Dev.toAlex Merced

Dimensions change. A customer moves cities. A product gets reclassified. An employee changes departments. How your data model handles these changes determines whether your historical reports are accurate or misleading. Slowly Changing Dimensions (SCDs) are design patterns for managing dimension attribute changes over time. The three most common types — overwrite, track history, and track one change — each make a different tradeoff between simplicity and historical accuracy. Why Dimensions Change Dimension tables store descriptive attributes: customer addresses, product categories, employee titles. These attributes don't stay constant. A customer who was in "New York" last quarter is now in "Chicago." A product that was in "Accessories" is now in "Electronics." If your fact table recorded sales tied to that customer, do last quarter's reports show "New York" (where the customer was at the time of the sale) or "Chicago" (where the customer is now)? The answer depends on your SCD type. Ty

Continue reading on Dev.to

Opens in a new tab

Read Full Article
8 views

Related Articles