Introduction to dbt (Data Build Tool) & Analytics Engineering Workflow
Use dbt to version SQL transforms, tests, and docs as the analytics engineering workflow.
In plain words
Warehouse raw tables and freshness. Next, staging/intermediate/marts with ref and source. Finally, docs, manifest, exposures, and run artifacts.
Think of it like…
dbt is a compiler and quality harness for the warehouse's SQL factory; an orchestrator is the shift calendar that decides when each factory line starts.
Where you’ve seen it
dbt build --select tag:daily+ compiles ref('fct_orders') dependencies, executes models/tests for the graph, and writes manifest.json/run_results.json for lineage, audit, and selective promotion.
Words you’ll hear
- dbt
- Data Build Tool, a framework for SQL/Jinja transformation graphs, tests, snapshots, docs, and adapters.
- Analytics Eng
- An analytics-focused role combining SQL model design, business semantics, software practices, and quality ownership.
- SQL Transforms
- Warehouse SQL nodes compiled from models and dependencies, not a replacement for arbitrary external ETL code.
- Operational boundary
- Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality. Use dbt for transformations/tests/docs, let a source system and orchestrator own extraction/scheduling, compile models in CI, and run state-aware builds with failure policy and post-run artifact collection.
Visual diagram
Theory & deep dive
dbt: the working mechanism
dbt turns versioned SQL/Jinja models, tests, snapshots, documentation, and compilation into a dependency graph that a warehouse executes, while analytics engineers own modular business transforms.
Warehouse raw tables and freshness. Staging/intermediate/marts with ref and source, then compile SQL, run nodes, evaluate assertions; this exposes the state governed by SQL Transforms.
dbt build --select tag:daily+ compiles ref('fct_orders') dependencies, executes models/tests for the graph, and writes manifest.json/run_results.json for lineage, audit, and selective promotion.
Introduction to dbt & Analytics Engineering Workflow: failure mode and production response
Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality.
Use dbt for transformations/tests/docs, let a source system and orchestrator own extraction/scheduling, compile models in CI, and run state-aware builds with failure policy and post-run artifact collection. Track Build selection as "models and dependent tests included explicitly", and make Manifest visible to the dataset owner.
How it works, step by step
Step 1 of 41. Define sources
Warehouse raw tables and freshness. dbt turns versioned SQL/Jinja models, tests, snapshots, documentation, and compilation into a dependency graph that a warehouse executes, while analytics engineers own modular business transforms.
- Build selection
- models and dependent tests included explicitly
- Analytics Eng
- An analytics-focused role combining SQL model design, business semantics, software practices, and quality ownership.
When to use it & trade-offs
What it is
dbt turns versioned SQL/Jinja models, tests, snapshots, documentation, and compilation into a dependency graph that a warehouse executes, while analytics engineers own modular business transforms. dbt build --select tag:daily+ compiles ref('fct_orders') dependencies, executes models/tests for the graph, and writes manifest.json/run_results.json for lineage, audit, and selective promotion.
Why it matters: Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality. Use dbt for transformations/tests/docs, let a source system and orchestrator own extraction/scheduling, compile models in CI, and run state-aware builds with failure policy and post-run artifact collection.
When to reach for it
- Use dbt to version SQL transforms, tests, and docs as the analytics engineering workflow.
- Choose dbt because it provides this capability: Data Build Tool, a framework for SQL/Jinja transformation graphs, tests, snapshots, docs, and adapters.
- Keep evidence for Build selection at "models and dependent tests included explicitly" so the last production stage-Publish evidence - docs, manifest, exposures, and run artifacts-remains testable.
When to avoid or be careful
- Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality.
- Do not conflate Analytics Eng with dbt. The second concept contributes different behavior: An analytics-focused role combining SQL model design, business semantics, software practices, and quality ownership.
- Release only after this guardrail is in place: Use dbt for transformations/tests/docs, let a source system and orchestrator own extraction/scheduling, compile models in CI, and run state-aware builds with failure policy and post-run artifact collection.
dbt / Analytics Eng / SQL Transforms - roles, limits, and operating cost
Strengths: Data Build Tool, a framework for SQL/Jinja transformation graphs, tests, snapshots, docs, and adapters. dbt turns versioned SQL/Jinja models, tests, snapshots, documentation, and compilation into a dependency graph that a warehouse executes, while analytics engineers own modular business transforms.
Watch out: Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality.
Strengths: An analytics-focused role combining SQL model design, business semantics, software practices, and quality ownership. In this workflow it supports: Build/test - compile SQL, run nodes, evaluate assertions.
Watch out: The operating cost is real: compile-time graph and model configuration artifact.
Strengths: Warehouse SQL nodes compiled from models and dependencies, not a replacement for arbitrary external ETL code. Its output can be checked with Run result.
Watch out: Operating guardrail: Use dbt for transformations/tests/docs, let a source system and orchestrator own extraction/scheduling, compile models in CI, and run state-aware builds with failure policy and post-run artifact collection.
Interview signals & numbers to know
When this topic comes up
- “Where is the failure boundary for dbt, and how would Build selection reveal it?”
- “Why is Analytics Eng distinct from this behavior: warehouse SQL nodes compiled from models and dependencies, not a replacement for arbitrary external ETL code?”
- Production clue: Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality.
- Design probe: Use dbt for transformations/tests/docs, let a source system and orchestrator own extraction/scheduling, compile models in CI, and run state-aware builds with failure policy and post-run artifact collection.
Benchmarks & rules of thumb
- Build selection
- models and dependent tests included explicitly
- Manifest
- compile-time graph and model configuration artifact
- Run result
- node status, timing, failures, and executed SQL evidence
Common mistakes & follow-ups
Common interview mistakes
- Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality.
- Reporting success from a job exit code without checking Build selection and Manifest.
- Treating this example as complete without replay, rollback, or access boundaries:
dbt build --select tag:daily+compilesref('fct_orders')dependencies, executes models/tests for the graph, and writesmanifest.json/run_results.jsonfor lineage, audit, and selective promotion.
Likely interviewer follow-ups
- How would you prove this contract instead of only checking that the command ran: Data Build Tool, a framework for SQL/Jinja transformation graphs, tests, snapshots, docs, and adapters.
- What does the recovery plan do when this occurs? Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality.
- When is dbt insufficient for Manifest, and what does adding Analytics Eng cost in Build selection?
Knowledge check
Put it into practice
Practice related interview Q&A
Apply Introduction to dbt (Data Build Tool) & Analytics Engineering Workflow with data engineer interview Q&A and hands-on practice.