Star Schema
ELI5 — The Vibe Check
A star schema organizes your warehouse like a star. In the center is a fact table with measurements (sales amounts, click counts), and around it are dimension tables with descriptive attributes (customer info, product details, dates). It's called a star because the diagram literally looks like a star. Simple, fast to query, and analytics-friendly.
Real Talk
A star schema is a data warehouse modeling technique with a central fact table containing measurable events (metrics, foreign keys) surrounded by denormalized dimension tables containing descriptive attributes. This design minimizes joins, simplifies queries, and optimizes for read-heavy analytical workloads. It trades storage efficiency for query performance compared to normalized schemas.
Show Me The Code
-- Fact table at the center
SELECT d.month_name, p.category, SUM(f.revenue)
FROM fact_sales f
JOIN dim_date d ON f.date_id = d.id
JOIN dim_product p ON f.product_id = p.id
GROUP BY d.month_name, p.category;
When You'll Hear This
"Star schemas make dashboard queries fast and intuitive." / "Our fact table has 500 million rows but queries run in seconds thanks to the star schema."
Related Terms
Columnar Storage
Columnar storage saves data column by column instead of row by row. All the ages together, all the names together, all the emails together.
Data Warehouse
A data warehouse is where all your company's data goes to be analyzed.
OLAP
OLAP is all about analyzing huge amounts of data to answer business questions. 'What were total sales by region last quarter?' That's an OLAP query.
Snowflake Schema
A snowflake schema is a star schema where the dimension tables are normalized into sub-tables, making the diagram look like a snowflake.