← Lessons

quiz vs the machine

Gold1340

System Design

The Star Schema

The classic warehouse layout of one fact table surrounded by dimension tables.

4 min read · core · beat Gold to climb

Facts at the center

A star schema organizes a warehouse around a central fact table surrounded by dimension tables, drawn like a star.

  • The fact table stores measurable events, like a sale, with numeric measures such as amount and quantity, plus foreign keys to dimensions. It is long and narrow and grows constantly.
  • Dimension tables store descriptive context, like the customer, product, store, and date. They are short and wide and change slowly.

Why this shape

Analysts slice measures by dimensions, asking for total sales by product by month. The star keeps joins shallow, just one hop from the fact to each dimension, which makes queries fast and easy to write. Denormalizing dimensions trades some redundancy for simpler, quicker joins.

A snowflake schema normalizes dimensions into sub tables, reducing redundancy but adding join hops. The star is preferred when query speed and simplicity matter more than storage.

Key idea

A star schema places a numeric fact table at the center with denormalized dimension tables one join away, giving fast simple analytical queries.

Check yourself

Answer to earn rating on the learn ladder.

1. What does the fact table store?

2. Why is the star schema fast for analytics?