Slowly Changing Dimensions (SCD)

Introduction

Slowly changing dimensions (SCD) are used to capture changing data within the dimension over time. How could we track the changes in the example below?

Types of SCD

Type 1 - Overwrite

  • Replace all existing data

  • Lose historical data

  • Often used for data corrections

Type 2 - Add historical columns

To analyse historical data, you will need to understand when the customer was from Corporate and Retail.

  • Creates additional records on each changing record event

  • History of dimension changes are kept

  • Expensive database operation

  • Adds a surrogate key

Surrogate key

  • Sequentially generated unique number

  • Eliminate source system dependency

  • Increase performance with using suitable data type on joins

Last updated