internalsGet Pro

Module 05 · Lesson 9 of 12Pro

Modeling events and clickstreams

Level
Intermediate
Topic
Data modeling for analytics
Reading time
17 min

When you finish this page you can

  1. Model click events as one fact table at one row per event, with keys every event type shares and no measure but the row itself.
  2. Give every event a dimension key, using separate rows for “unknown” and “not applicable” instead of NULL.
  3. Build visit and product-per-day tables from the event table, and know which of their counts can be added up.
  4. Combine click counts and order lines through shared dimensions, without joining the two fact tables row to row.
  1. Sessionization: grouping events into visits with SQL17 min
  2. Semi-structured data: querying JSON in SQL17 min
  3. Grain: deciding what one row means16 min

Every tile rereads 3.9 billion clicks

is an online store in India. Every night Meera, its data engineer, loads the day’s orders and about 10 million click events from the store’s PostgreSQL read replica into a file on one 8 GB server. Daniel’s finance team reads the order tables; the product and category teams read the clicks.

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