Interview's MateData Engineer
Interview's Mate

Data Engineer

SQL · Spark · Lakehouse · Streaming

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Data Engineer topics
Lesson 54/ 160
03. Data Warehousing & Data Modeling

Google BigQuery Architecture (Dremel, Partitioning, Clustering, Slots)

Tune BigQuery with partitioning, clustering, and slot awareness on top of the Dremel execution model.

AdvancedDremel · Slots · Partition/Cluster3 quiz questions
Practice Generative AI Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

In plain words

Bound the dominant time or range filter. Next, co-locate repeated filter/group values. Finally, bytes, reservations, and query bytes limits.

Think of it like…

Dremel fans a query down a tree of workers that read narrow leaves in parallel; partition labels tell each worker which bookshelves to skip before opening them.

Where you’ve seen it

WHERE event_date='2026-11-21' prunes a PARTITION BY event_date table; CLUSTER BY customer_id, device_type orders within storage blocks, but query performance is still constrained by slot count and shuffle.

Words you’ll hear

Dremel
Google's columnar distributed query architecture with serving-tree style parallel scans and aggregation.
Slots
Units of BigQuery compute capacity used for query execution and allocated on demand or via reservations.
Partition/Cluster
Physical time/range partitioning for pruning, plus storage-block clustering for frequently filtered/grouped columns.
Operational boundary
SELECT * scans every column and missing partition filters consume terabytes; clustering can only help within partitions, while too-few slots or heavy joins create queue and shuffle latency that a bigger label does not diagnose. Enforce partition predicates, project only needed columns, choose date/time or integer range partitions deliberately, cluster by common filter/group keys, inspect execution and bytes billed, and reserve slots when demand is predictable.

Visual diagram

Loading interactive diagram

Theory & deep dive

Dremel: the working mechanism

BigQuery executes columnar SQL through Dremel's distributed tree, offering on-demand byte-scan billing or reservations of slots, with table partitioning and clustering to reduce bytes and shuffle work.

Bound the dominant time or range filter. Co-locate repeated filter/group values, then slots read, shuffle, and join in Dremel tree; this exposes the state governed by Partition/Cluster.

Google BigQuery Architecture in one concrete design

WHERE event_date='2026-11-21' prunes a PARTITION BY event_date table; CLUSTER BY customer_id, device_type orders within storage blocks, but query performance is still constrained by slot count and shuffle.

Key takeaway: BigQuery executes columnar SQL through Dremel's distributed tree, offering on-demand byte-scan billing or reservations of slots, with table partitioning and clustering to reduce bytes and shuffle work

Google BigQuery Architecture: failure mode and production response

SELECT * scans every column and missing partition filters consume terabytes; clustering can only help within partitions, while too-few slots or heavy joins create queue and shuffle latency that a bigger label does not diagnose.

Enforce partition predicates, project only needed columns, choose date/time or integer range partitions deliberately, cluster by common filter/group keys, inspect execution and bytes billed, and reserve slots when demand is predictable. Track Bytes billed as "primary cost meter for on-demand queries", and make Maximum bytes billed visible to the dataset owner.

Key takeaway: Enforce partition predicates, project only needed columns, choose date/time or integer range partitions deliberately, cluster by common filter/group keys, inspect execution and bytes billed, and reserve slots when demand is predictable.

How it works, step by step

Step 1 of 4
Dremel

1. Partition

Bound the dominant time or range filter. BigQuery executes columnar SQL through Dremel's distributed tree, offering on-demand byte-scan billing or reservations of slots, with table partitioning and clustering to reduce bytes and shuffle work.

bound the dominant time or range filter
Key numbers at this step
Bytes billed
primary cost meter for on-demand queries
Slots
Units of BigQuery compute capacity used for query execution and allocated on demand or via reservations.

When to use it & trade-offs

What it is

BigQuery executes columnar SQL through Dremel's distributed tree, offering on-demand byte-scan billing or reservations of slots, with table partitioning and clustering to reduce bytes and shuffle work. WHERE event_date='2026-11-21' prunes a PARTITION BY event_date table; CLUSTER BY customer_id, device_type orders within storage blocks, but query performance is still constrained by slot count and shuffle.

Why it matters: SELECT * scans every column and missing partition filters consume terabytes; clustering can only help within partitions, while too-few slots or heavy joins create queue and shuffle latency that a bigger label does not diagnose. Enforce partition predicates, project only needed columns, choose date/time or integer range partitions deliberately, cluster by common filter/group keys, inspect execution and bytes billed, and reserve slots when demand is predictable.

When to reach for it

  • Tune BigQuery with partitioning, clustering, and slot awareness on top of the Dremel execution model.
  • Choose Dremel because it provides this capability: Google's columnar distributed query architecture with serving-tree style parallel scans and aggregation.
  • Keep evidence for Bytes billed at "primary cost meter for on-demand queries" so the last production stage-Charge and govern - bytes, reservations, and query bytes limits-remains testable.

When to avoid or be careful

  • SELECT * scans every column and missing partition filters consume terabytes; clustering can only help within partitions, while too-few slots or heavy joins create queue and shuffle latency that a bigger label does not diagnose.
  • Do not conflate Slots with Dremel. The second concept contributes different behavior: Units of BigQuery compute capacity used for query execution and allocated on demand or via reservations.
  • Release only after this guardrail is in place: Enforce partition predicates, project only needed columns, choose date/time or integer range partitions deliberately, cluster by common filter/group keys, inspect execution and bytes billed, and reserve slots when demand is predictable.

Dremel / Slots / Partition/Cluster - roles, limits, and operating cost

Dremel
Best for: Google's columnar distributed query architecture with serving-tree style parallel scans and aggregation.

Strengths: Google's columnar distributed query architecture with serving-tree style parallel scans and aggregation. BigQuery executes columnar SQL through Dremel's distributed tree, offering on-demand byte-scan billing or reservations of slots, with table partitioning and clustering to reduce bytes and shuffle work.

Watch out: SELECT * scans every column and missing partition filters consume terabytes; clustering can only help within partitions, while too-few slots or heavy joins create queue and shuffle latency that a bigger label does not diagnose.

Slots
Best for: Units of BigQuery compute capacity used for query execution and allocated on demand or via reservations.

Strengths: Units of BigQuery compute capacity used for query execution and allocated on demand or via reservations. In this workflow it supports: Plan - slots read, shuffle, and join in Dremel tree.

Watch out: The operating cost is real: hard guardrail in jobs to prevent accidental full scans.

Partition/Cluster
Best for: Physical time/range partitioning for pruning, plus storage-block clustering for frequently filtered/grouped columns.

Strengths: Physical time/range partitioning for pruning, plus storage-block clustering for frequently filtered/grouped columns. Its output can be checked with Partitions.

Watch out: Operating guardrail: Enforce partition predicates, project only needed columns, choose date/time or integer range partitions deliberately, cluster by common filter/group keys, inspect execution and bytes billed, and reserve slots when demand is predictable.

Interview signals & numbers to know

When this topic comes up

  • “Where is the failure boundary for Dremel, and how would Bytes billed reveal it?”
  • “Why is Slots distinct from this behavior: physical time/range partitioning for pruning, plus storage-block clustering for frequently filtered/grouped columns?”
  • Production clue: SELECT * scans every column and missing partition filters consume terabytes; clustering can only help within partitions, while too-few slots or heavy joins create queue and shuffle latency that a bigger label does not diagnose.
  • Design probe: Enforce partition predicates, project only needed columns, choose date/time or integer range partitions deliberately, cluster by common filter/group keys, inspect execution and bytes billed, and reserve slots when demand is predictable.

Benchmarks & rules of thumb

Bytes billed -
primary cost meter for on-demand queries
Maximum bytes billed -
hard guardrail in jobs to prevent accidental full scans
Partitions -
BigQuery permits thousands of partitioned segments with per-query limits depending on type

Common mistakes & follow-ups

Common interview mistakes

  • SELECT * scans every column and missing partition filters consume terabytes; clustering can only help within partitions, while too-few slots or heavy joins create queue and shuffle latency that a bigger label does not diagnose.
  • Reporting success from a job exit code without checking Bytes billed and Maximum bytes billed.
  • Treating this example as complete without replay, rollback, or access boundaries: WHERE event_date='2026-11-21' prunes a PARTITION BY event_date table; CLUSTER BY customer_id, device_type orders within storage blocks, but query performance is still constrained by slot count and shuffle.

Likely interviewer follow-ups

  • How would you prove this contract instead of only checking that the command ran: Google's columnar distributed query architecture with serving-tree style parallel scans and aggregation.
  • What does the recovery plan do when this occurs? SELECT * scans every column and missing partition filters consume terabytes; clustering can only help within partitions, while too-few slots or heavy joins create queue and shuffle latency that a bigger label does not diagnose.
  • When is Dremel insufficient for Maximum bytes billed, and what does adding Slots cost in Bytes billed?
Interview tip: Lead with the data path and failure boundary: BigQuery executes columnar SQL through Dremel's distributed tree, offering on-demand byte-scan billing or reservations of slots, with table partitioning and clustering to reduce bytes and shuffle work. Then make the answer operational: Enforce partition predicates, project only needed columns, choose date/time or integer range partitions deliberately, cluster by common filter/group keys, inspect execution and bytes billed, and reserve slots when demand is predictable.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Google BigQuery Architecture (Dremel, Partitioning, Clustering, Slots) with data engineer interview Q&A and hands-on practice.

Open Data Engineer Q&A →Machine Learning Q&A
Previous topic
Snowflake Architecture (Storage, Virtual Warehouses, Micro-Partitions, Clustering)
Next topic
Amazon Redshift Architecture (Distribution Styles, Sort Keys, Spectrum)