All Questions
Data Modeling medium

A user changes their address. You need to keep their old address for historical reporting of past orders. Which pattern fits best?

  1. A SCD Type 2: A new row is added for the new address with a specific validity range, ensuring that historical orders remain linked to the address used at that time.
  2. B SCD Type 1: The system simply overwrites the existing address record with the new data, assuming that historical accuracy is not a requirement for the domain.
  3. C SCD Type 3: The table schema is modified to include a single `previous_address` column that acts as a basic, one-step history for the most recent change.
  4. D SCD Type 0: The user record is deleted and recreated from scratch to ensure that all database-level internal pointers and caches are fully refreshed.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions