data-infra

Star Schema

A star schema is a warehouse modelling pattern in which a central fact table — one row per event or measurement, such as an order line or a usage record — is surrounded by dimension tables that describe the entities involved: customer, product, date, channel. The fact table holds the numbers and foreign keys; dimensions hold the descriptive attributes you filter and group by. Drawn out, the fact table sits in the middle with dimensions radiating from it, which is where the name comes from. The design exists because analytical queries have a different shape from transactional ones. Normalised operational schemas minimise duplication for writes; a star schema deliberately denormalises dimensions so a typical question — revenue by region by month for one product line — resolves with few joins and predictable scan patterns. It is also easier for analysts and BI tools to reason about, which matters as much in practice as query cost, and it maps cleanly onto a semantic layer where the metric definitions live. Two details cause most of the trouble. Choosing the grain of the fact table — what exactly one row represents — is the decision everything else depends on, and mixing grains in one table produces silently wrong aggregates. And dimension attributes change over time, so the schema needs an explicit policy on whether a customer's old orders show their old segment or their current one; that question is the subject of slowly changing dimensions and is not answerable by the model alone.

Related terms

More Data & Infra terms