Cloud Data Warehouses

How BigQuery, Snowflake and Redshift store and bill for analytical data, and what changes when you query them.

Intermediate · about 4 hours · difficulty 3/5

Learn first: Data Modelling: Normalization and Star Schemas

Most modern companies centralise analytics data in a cloud warehouse. You will likely use one of three: BigQuery (Google Cloud), Snowflake (multi-cloud) or Amazon Redshift (AWS). Databricks SQL and other lakehouse engines are also common. The SQL is largely the same; the differences are in architecture, dialect and cost.

What makes warehouses different

  • Columnar storage: only the columns you select are read, so SELECT * is expensive and narrow queries are cheap.
  • Separation of storage and compute: many users can query the same data concurrently.
  • Massive parallelism: billions of rows aggregate in seconds.
  • Semi-structured data: JSON, arrays and nested records are first-class (BigQuery's UNNEST, Snowflake's VARIANT and FLATTEN).

Cost awareness

  • BigQuery on-demand bills by bytes scanned; always check the estimate before running and use partitioned tables.
  • Snowflake bills for warehouse (compute) time; suspend idle warehouses.
  • Redshift bills for cluster or serverless capacity.

Preview a table instead of SELECT * LIMIT 10, which may still scan the whole thing in some engines.

Getting hands-on for free

BigQuery's sandbox and public datasets (Google Analytics sample, NYC taxis, Stack Overflow) let you practise real warehouse SQL at no cost. Snowflake offers a free trial.

Typical layers

Raw data lands via ingestion tools, gets cleaned into staging models, then into business-ready marts. Analysts mostly query the marts, which is the analytics engineering topic later in this track.

Pitfall: assuming every function name works across warehouses. Move on when you have run queries against a BigQuery public dataset and can explain what drives its cost.

Key concepts

  • BigQuery: Free sandbox and public datasets
  • Snowflake
  • Amazon Redshift
  • Columnar storage
  • Cost models and query estimates
  • Nested and JSON data, UNNEST
  • Raw, staging and mart layers
  • Lakehouses and Databricks SQL

Mini project

In the BigQuery sandbox, query the public Google Analytics sample or Stack Overflow dataset to find monthly trends, noting the bytes processed for each query and reducing it by selecting fewer columns.

Check yourself

Why does adding LIMIT 10 not necessarily reduce the cost of a BigQuery query?

Free resources