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.

Intermediate · about 4 hours · difficulty 3/5

Learn first: Dimensional Modeling: Star and Snowflake Schemas, Object Storage, Partitioning and Data Lake 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