In the Data Maturity Lifecycle, Level 2 represents the transition from fragmented spreadsheets to a Centralized Warehouse. This stage is characterized by Schema-on-Write and high-performance SQL analytics.
The primary goal of Level 2 is to create a "Single Source of Truth." Data is extracted from operational RDBMS (MySQL, Postgres) via ETL and loaded into a specialized analytical engine (Snowflake, BigQuery, Redshift).
Analytical performance in a warehouse relies on Dimensional Modeling.
revenue, quantity) and keys to dimensions.CustomerName, Region).The "Grain" is the most critical decision in warehouse design.
-- Example: Defining the grain at the Line-Item level
CREATE TABLE fact_sales (
order_id UUID,
product_id INT,
customer_id INT,
date_id INT,
quantity INT,
sale_price DECIMAL(10,2),
-- Foreign keys to dimensions
CONSTRAINT fk_customer FOREIGN KEY (customer_id) REFERENCES dim_customer(customer_id)
);
Rule: Always store data at the Atomic Grain. Aggregating during load (e.g., "Daily Sales") is a Level 1 behavior that prevents future drill-down analysis.
While the Star Schema is optimized for read performance by minimizing joins, it introduces Rigidity.
To maintain historical accuracy, warehouses use SCD patterns.
-- Querying SCD Type 2 for point-in-time accuracy
SELECT
s.sale_price,
c.customer_city
FROM fact_sales s
JOIN dim_customer c ON s.customer_id = c.customer_id
WHERE s.sale_date BETWEEN c.row_start_date AND c.row_end_date;
As maturity increases, the centralized warehouse becomes a bottleneck.
See Also: