Data & Retrieval

Star Schema

A data-warehouse layout with one central fact table linked to descriptive dimension tables — simple and fast for analytics.

A star schema organizes a data warehouse around a central fact table (the measurable events — sales, clicks) surrounded by dimension tables (the descriptive context — date, product, customer). The fact table holds foreign keys to each dimension, forming a star shape, and is denormalized for query speed.

Worked example: a sales fact table with one row per sale (amount, quantity, and keys to date/product/store dimensions) lets “total sales by product category by month” join fact to two dimensions and aggregate — simple and fast. Gotcha: star schemas duplicate descriptive data for speed (a snowflake schema normalizes dimensions to reduce that, at the cost of more joins), and they assume a read-mostly analytical workload — the wrong shape for a transactional app.