Back to Catalog
Data Science
Data Warehouse
Dimensional Modeling
Organizes data into fact tables (metrics) and dimension tables (descriptive attributes) for intuitive querying.
Intent & Description
📋 Context
Dimensional modeling, popularized by Ralph Kimball, structures data warehouses for intuitive querying and performance. Facts are numeric measurements, dimensions provide context.
Real-world Use Case
Data warehouses, business intelligence tools, and analytics platforms where business users need intuitive data access.
Advantages
- Intuitive for business users
- Query performance
- BI tool compatibility
- Standardized approach
Disadvantages
- Schema rigidity
- Redundancy storage
- ETL complexity
- Not suitable for all use cases
Implementation Example
# Dimensional Modeling Pattern # Fact table: sales transactions fact_sales = { "sale_id": 1, "date_key": 20260101, "customer_key": 101, "product_key": 201, "revenue": 100.00, "quantity": 2 }
# Dimension table: customer attributes dim_customer = { "customer_key": 101, "name": "Alice", "segment": "Premium", "region": "West" }
# Query: Revenue by customer segment # JOIN fact_sales with dim_customer on customer_key # GROUP BY dim_customer.segment, SUM(fact_sales.revenue)