Skip to content

What is a star schema?

A star schema organizes data for analysis into a central fact table, which holds the measurements, and into dimension tables that describe their context.

A star schema is a way to organize data for analysis: a central fact table holds measurements of an activity, while dimension tables describe its context, such as product, customer, and date. The tables are joined on keys, values that link matching rows. In a sales model, for example, one fact row can represent an item sold on an order and contain quantity and amount; dimensions let users group amounts by product or period. The name describes the diagram, with facts at the center and dimensions around them. The essential choice comes before the diagram: defining what each row represents, known as the grain. Without it, a sum that looks right can mix different events. The schema makes measurements and their context explicit, but does not by itself guarantee correct data, fast queries, or definitions shared across departments.

See also: Galaxy schemaA galaxy schema links several fact tables to shared dimensions so measures from different business processes can be compared by identically defined attributes.

How to design it

Kimball's description separates measurements from context and connects facts and dimensions through keys. The grain rule requires declaring the grain before choosing measures and dimensions, and never mixing grains in one table. Item-level rows and monthly-total rows therefore belong in separate tables: adding them together would count some sales twice.

Aggregation matters too. Under the rules of additivity, a balance can be summed across accounts, but not across dates as though it were a transaction; a ratio is best calculated after summing its components. If a fact belongs to several categories at once, a bridge table can represent the relationship without forcing it into a single category.

An enterprise example

A retail chain wants to compare revenue by product, store, and month. It sets the grain at one product on a sales receipt, with quantity and amount as measures; dimensions identify product, store, and date. Before handoff, the sales manager and the data team agree on whether amounts include discounts and how to handle returns and duplicate rows. The monthly total is reconciled against the source data, a check that no star layout replaces.

If a product changes category, the team must decide whether historical reports retain the previous category. Slowly changing dimensions cover that choice. When sales and inventory require separate facts, the galaxy schema coordinates multiple fact tables.

Why it matters for decision makers

In an RFP, specifying the grain, measure definitions, history handling, and reconciliation checks is more useful than asking for a star schema alone. Dimension attributes become the filters and labels on reports, as Kimball explains; those attributes need a named owner. A single table can be an alternative for specific needs: the comparison of One Big Table and dimensional modeling helps assess the tradeoff. Performance must be measured on real data and queries; a diagram cannot guarantee it.

Frequently asked questions

Facts record measurements of an activity; dimensions describe its context, such as product or date.

No. You also need shared definitions, data checks, and rules for aggregating measures correctly.

You usually start with the most detailed level the process records, such as one product on a receipt, and then check that the measures and dimensions match that level.
  • Galaxy schemaA galaxy schema links several fact tables to shared dimensions so measures from different business processes can be compared by identically defined attributes.
  • Data martA subset of the data warehouse dedicated to a single department or domain, built to answer specific questions faster.
  • Bridge tableAn intermediate table linking facts and dimensions when the relationship is many-to-many, preventing double counting.
  • Slowly Changing Dimensions (SCD)Slowly Changing Dimensions are techniques for managing changes to descriptive data over time and choosing which historical values to keep for reporting.
  • One Big Table (OBT) vs Dimensional ModelingOBT and dimensional modeling organize analytical data differently: a single wide table ready to query, or reusable fact and dimension tables for reports.

See it in the universe

If it touches your company's data, getting that data in order is the first thing I do.

See Data Foundations

Or write to me.