internalsGet Pro

Module 05 · Lesson 6 of 12Pro

Slowly changing dimensions: types 1, 2 and 3

Level
Intermediate
Topic
Data modeling for analytics
Reading time
17 min

When you finish this page you can

  1. Decide, column by column, whether a change in a dimension should rewrite history, keep it, or keep one previous value.
  2. Build a type 2 dimension with validity dates and a current-row flag, and update it safely each night.
  3. Load facts so each row points at the version that was true on the day of the event.
  4. Spot the columns where type 2 history grows too fast, and what to do instead.

Builds on 3 lessons

Start with lesson 317 min
  1. Dimensional modeling: facts and dimensions17 min
  2. Star and snowflake schemas18 min
  3. Grain: deciding what one row means16 min

October’s Pune revenue changed in November

is an online store in India. Every night Meera, its data engineer, loads the day’s orders, about 60,000 of them, and a copy of its customers from the store’s PostgreSQL read replica into a file on one 8 GB server. Daniel, who leads finance reporting, reads the numbers at 07:00.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan