# How Cloud Data Warehouses Work

> Understand MPP execution, separation of storage and compute, micro-partitions and clustering, loading patterns and the pricing models that shape design. Free...

Canonical: https://www.internhack.in/roadmaps/tracks/data-engineer/warehouse-concepts
Last updated: 2026-11-28

Understand MPP execution, separation of storage and compute, micro-partitions and clustering, loading patterns and the pricing models that shape design.

Intermediate · about 4 hours · difficulty 3/5

Learn first: [Dimensional Modeling: Star and Snowflake Schemas](https://www.internhack.in/roadmaps/tracks/data-engineer/dimensional-modeling), [Object Storage, Partitioning and Data Lake Layout](https://www.internhack.in/roadmaps/tracks/data-engineer/object-storage-layout)

Cloud warehouses are where most modeled data ends up. They look like normal SQL databases, but their internals explain both their speed and their bills.

### Architecture

- **MPP (massively parallel processing)**: a query is split across many compute nodes, each scanning part of the data.
- **Columnar, compressed storage** in the cloud provider's object store.
- **Separation of storage and compute**: storage is cheap and shared; compute (warehouses, slots, clusters) scales independently and can be paused.

### Organising data inside the warehouse

- **Partitioning** (BigQuery by date, for example) and **clustering or sort keys** keep related rows together so the engine can prune.
- Metadata such as min and max per block lets queries skip most data when filters match the layout.
- Databases, schemas, tables, views and **materialized views**.

### Loading data

- Bulk loads from object storage (`COPY INTO`, load jobs) are cheap and fast.
- Row-by-row `INSERT` is slow and expensive; batch it.
- Streaming ingestion exists but usually costs more.
- External tables let you query files in the lake without loading them.

### Pricing models

- **On-demand per bytes scanned** (BigQuery default): selecting fewer columns and filtering on partitions saves money directly.
- **Compute time** (Snowflake credits, Redshift node hours): idle or oversized warehouses waste money.

Always check cost before running a big query on a company account.

### Pitfalls

- `SELECT *` on a multi-terabyte table "just to look". Use previews and LIMIT does not always reduce scan cost.
- Leaving a large compute cluster running overnight.
- Treating the warehouse like OLTP with frequent single-row updates.

You are ready to move on when you can explain why a BigQuery query filtered on the partition column costs less, and why a Snowflake warehouse left running at night costs money even with no queries.

## Key concepts

- **MPP execution**
- **Storage and compute separation**
- **Partitioning and clustering**
- **Bulk loading with COPY**
- **External tables**
- **Materialized views**
- **Pricing models**

## Mini project

Using the BigQuery sandbox (free, no card), query a public dataset twice: once with SELECT \* and once with only needed columns and a partition filter. Record bytes processed for each and explain the difference.

## Check yourself

Why does adding LIMIT 10 to a BigQuery query often not reduce the bytes billed?

## Free resources

- [BigQuery documentation](https://cloud.google.com/bigquery/docs) (Google Cloud)
- [Snowflake documentation](https://docs.snowflake.com/) (Snowflake)
- [Amazon Redshift documentation](https://docs.aws.amazon.com/redshift/) (AWS)

Previous: [Spark Performance Tuning and Operations](https://www.internhack.in/roadmaps/tracks/data-engineer/spark-tuning) · Next: [Snowflake](https://www.internhack.in/roadmaps/tracks/data-engineer/snowflake)

## More in Cloud Warehouses and Lakehouses

- [How Cloud Data Warehouses Work](https://www.internhack.in/roadmaps/tracks/data-engineer/warehouse-concepts)
- [Snowflake](https://www.internhack.in/roadmaps/tracks/data-engineer/snowflake)
- [Google BigQuery](https://www.internhack.in/roadmaps/tracks/data-engineer/bigquery)
- [Amazon Redshift](https://www.internhack.in/roadmaps/tracks/data-engineer/redshift)
- [Lakehouse Tables with Delta Lake](https://www.internhack.in/roadmaps/tracks/data-engineer/delta-lake)
- [Lakehouse Tables with Apache Iceberg](https://www.internhack.in/roadmaps/tracks/data-engineer/iceberg)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Data Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/data-engineer)
