The list above names the schema patterns. The sections below show how they relate, which workload each suits, and example SQL for the main dimensional shapes.
The following are common database schemas used in relational database management systems (RDBMS), including the Star Schema, from which the Snowflake Schema is derived:
These schemas are utilized based on the specific needs of the database structure, data integrity, and query complexity.
Schema patterns fall into two families. Transactional systems use normalized designs, usually third normal form, so that each fact is stored once and inserts and updates touch few rows. Analytical systems use dimensional designs, where data is shaped around business processes and the questions people ask. The star schema is the base dimensional pattern: one fact table joined to denormalized dimensions. A snowflake schema normalizes dimension hierarchies into separate tables. A galaxy, or fact constellation, schema has several fact tables that share conformed dimensions such as date and customer, so sales and inventory can be compared on the same keys.
A single organization usually uses several of these at once. Source applications stay in third normal form. A warehouse may land raw data in staging tables, integrate it in a normalized or Data Vault layer that tracks history and lineage, and then publish star schemas as data marts for reporting. Wide denormalized tables are sometimes built on top of marts for a single dashboard or machine learning feature set.
The choice between the patterns comes down to the workload. Normalization optimizes for correctness under frequent small writes: an address changes in one row, and every order sees the new value through a join. Dimensional modeling optimizes for reads by many people asking aggregate questions: data is loaded in batches by controlled pipelines, so redundancy is managed by the load process rather than by constraints. Columnar warehouses have narrowed the performance gap for joins, which is why snowflaked dimensions and even wide tables are more acceptable today than in row-oriented systems, but the clarity a star schema gives to business users remains its main advantage.
| Pattern | Strength | Weakness | Use for |
|---|---|---|---|
| 3NF | No redundancy, safe updates | Many joins for analytics | OLTP applications |
| Star | Simple joins, BI-friendly | Redundant dimension attributes | Data marts, reporting |
| Snowflake | Less redundancy, clear hierarchies | More joins | Large shared hierarchies |
| Galaxy | Cross-process analysis | Requires conformed dimensions | Enterprise warehouses |
| Data Vault | Auditable history, easy to extend | Not query-friendly directly | Integration layer |
| Wide table | No joins | Duplication, hard to maintain | Single-purpose outputs |
-- Two fact tables sharing conformed dim_date and dim_product
WITH sales AS (
SELECT d.month_key, f.product_key, SUM(f.quantity) AS units_sold
FROM fact_sales f JOIN dim_date d ON f.date_key = d.date_key
GROUP BY d.month_key, f.product_key
),
stock AS (
SELECT d.month_key, i.product_key, AVG(i.on_hand) AS avg_on_hand
FROM fact_inventory i JOIN dim_date d ON i.date_key = d.date_key
GROUP BY d.month_key, i.product_key
)
SELECT p.category, s.month_key,
SUM(s.units_sold) AS units_sold,
SUM(k.avg_on_hand) AS avg_on_hand
FROM sales s
JOIN stock k ON k.month_key = s.month_key AND k.product_key = s.product_key
JOIN dim_product p ON p.product_key = s.product_key
GROUP BY p.category, s.month_key;
Each fact is aggregated to a common grain before joining. Joining two fact tables directly at their native grain multiplies rows and inflates the sums, a mistake often called a fan trap.
Whatever pattern you pick, document the grain and keys of every table; that documentation prevents most of the problems listed above.