internalsGet Pro

Module 05 · Lesson 5 of 12Pro

Grain: deciding what one row means

Level
Intermediate
Topic
Data modeling for analytics
Reading time
16 min

When you finish this page you can

  1. Write a fact table’s grain as one sentence and a key, before choosing its columns.
  2. Choose between order, order-line and daily-summary grains from the questions the table must answer.
  3. Place a measure at the grain where it happens, and split an order-level amount across lines only with a written rule.
  4. Tell transaction, periodic snapshot and accumulating snapshot tables apart, and know which of their measures can be summed over time.
  1. Join pitfalls: duplicated and missing rows16 min
  2. Dimensional modeling: facts and dimensions17 min

One coupon counted twice, one category short

is an online store in India. Every night Meera, its data engineer, loads the day’s orders from the store’s PostgreSQL read replica into a DuckDB 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