Storage Layer

Data Warehouses: Optimized Storage for Analytical Workloads

A data warehouse is a subject-oriented, integrated, non-volatile, and time-variant collection of data designed to support management decision-making. Unlike operational databases optimized for transactional throughput, data warehouses are structured to support analytical queries that aggregate data across large datasets and historical time ranges.

The design of a data warehouse reflects a series of deliberate trade-offs between query performance, storage efficiency, transformation complexity, and the flexibility to accommodate new analytical requirements. Understanding these trade-offs is a prerequisite for selecting and implementing a warehouse architecture that serves the organization's specific analytics use cases.

Articles published on this website summarize publicly available information, industry research and educational materials.

Dimensional Modeling

Dimensional modeling is the predominant design methodology for data warehouse schemas. Developed by Ralph Kimball, the approach organizes data into fact tables and dimension tables that represent measurable business events and their descriptive context respectively.

Fact Tables

A fact table records individual business events or transactions — sales, web sessions, customer interactions — and contains numeric measures (revenue, quantity, duration) alongside foreign keys that reference dimension tables. The grain of a fact table — the precise level of detail each row represents — is the most important design decision in dimensional modeling. Declaring the grain clearly and consistently prevents ambiguity in downstream queries and ensures that aggregation produces correct results.

Fact tables are typically narrow (few columns) but extremely wide in row count. Columnar storage formats and compression are well suited to fact table storage.

Dimension Tables

Dimension tables provide descriptive context for the measures in fact tables. A customer dimension might contain customer ID, name, province, industry segment, and account tier. A product dimension might contain SKU, category, subcategory, and brand. Dimensions allow queries to filter, group, and label the measures in fact tables in ways that are meaningful to business users.

Dimensions tend to be wide (many descriptive columns) but relatively short in row count compared to fact tables. They are denormalized by design — attributes that would be normalized in a transactional schema are flattened into a single table for query simplicity and join performance.

Slowly Changing Dimensions

Dimension attributes change over time, and the strategy for handling these changes — known as Slowly Changing Dimension (SCD) management — determines whether historical queries accurately reflect the state of the dimension at the time of the event.

Type 1 SCD overwrites the current value with the new value, preserving no history. This is appropriate for corrections of data errors or for attributes where historical accuracy is not required.

Type 2 SCD creates a new row for each change, tracking the full history of attribute values with effective date ranges (effective_from and effective_to) and a current flag. A query joining a fact table to a Type 2 dimension must join on the surrogate key and the effective date range to retrieve the historically accurate attribute values at the time of each transaction.

Type 3 SCD adds a previous-value column to the dimension row, preserving only one level of history. This is less commonly used but appropriate for specific use cases where only one historical state is required.

Schema Design Patterns

The star schema organizes a central fact table surrounded by multiple dimension tables, connected through foreign key relationships. Its denormalized structure minimizes join complexity and produces highly readable SQL queries. The star schema is the standard choice for most analytical reporting environments.

The snowflake schema extends the star by normalizing dimension tables into sub-dimensions, reducing storage redundancy at the cost of additional joins. While snowflake schemas may reduce storage requirements, the additional joins can degrade query performance and complicate SQL authoring for business users.

The Data Vault modeling methodology provides an alternative approach designed for auditability, historical tracking, and agility in the face of changing source systems. Data Vault organizes data into Hubs (unique business keys), Links (relationships between hubs), and Satellites (descriptive context over time). It is more complex to implement and query than dimensional modeling but offers structural advantages for organizations with strict auditing requirements or high rates of source system change.

Query Optimization

Query performance in a data warehouse is influenced by physical data organization, statistics maintenance, query plan quality, and resource allocation. Understanding the primary optimization levers is essential for maintaining acceptable query performance as data volumes and concurrency grow.

Distribution keys (in MPP systems such as Redshift or Synapse) determine how data is distributed across compute nodes. Distributing fact tables on the same key as their most common join dimension eliminates data shuffling across nodes during joins, which is one of the most expensive operations in distributed query execution.

Sort keys and cluster keys control the physical ordering of data on disk, enabling the query engine to skip irrelevant data blocks through zone maps or bloom filters. Choosing sort keys that align with the most common filter predicates — typically date columns and high-cardinality business keys — reduces the volume of data scanned per query.

Materialized views pre-compute and store the results of expensive aggregations or joins, allowing the query engine to answer common queries against the cached result set rather than re-executing the underlying computation. Maintenance of materialized views introduces a write-time cost that must be weighed against the read-time benefit.

Modern Cloud Warehouses

Cloud-native data warehouses such as Snowflake, Google BigQuery, Amazon Redshift, Azure Synapse Analytics, and Databricks SQL have largely supplanted on-premises MPP appliances for new enterprise deployments. These platforms separate compute from storage, allowing independent scaling of each resource tier and enabling consumption-based cost models that align spending with actual query workloads.

Canadian organizations selecting cloud warehouse platforms should evaluate data residency capabilities. All major platforms offer Canadian regions (Canada Central in Azure, ca-central-1 in AWS, northamerica-northeast1 in GCP), and data residency configuration must be validated against the platform's cross-region replication and metadata storage practices.