</>

BigQuery — Serverless Data Warehouse

Beginner

Petabyte-scale SQL with no servers — datasets, tables, pricing models, and partitioning.

dataanalyticssqlwarehouse

Mental model

BigQuery is a serverless, columnar data warehouse: you load (or stream) data and run SQL over it at scale, with no clusters to manage. Storage and compute are separate — you store cheaply and pay for compute only when a query runs. It’s built for analytics (scan/aggregate huge tables), not for high-QPS transactional reads.

Hierarchy: Project → Dataset (a namespace, tied to a location) → Table.

Pricing — the part that bites

Two habits cut on-demand cost dramatically:

Commands (read-only)

bq mk --dataset --location=US PROJECT_ID:analytics

# Load newline-delimited JSON, autodetecting the schema
bq load --autodetect --source_format=NEWLINE_DELIMITED_JSON \
  analytics.events ./events.json
# Query — scans only the columns referenced
bq query --use_legacy_sql=false \
  'SELECT user_id, COUNT(*) AS n
   FROM `PROJECT_ID.analytics.events`
   WHERE event_date = "2026-06-01"
   GROUP BY user_id
   ORDER BY n DESC
   LIMIT 10'

Cost reflex: never SELECT * on a big table; filter on the partition column; use the dry-run/estimator to see bytes scanned before running an expensive query.

Mark your progress with this note: