Learn Data Engineering Intermediate

Building Resilient Data Pipelines with Spark and dbt

Try This First

Test your knowledge before reading. Don't worry if you get it wrong — that's part of learning.

Key Insights

  • Combine Spark's processing power with dbt's transformation layer to build production-grade, tested, documented data pipelines.
Difficulty: Intermediate Type: Learn

Architecture: Spark + dbt

The modern data stack combines Spark for heavy ETL processing with dbt for SQL-based transformations, testing, and documentation:

  • Spark — ingestion, heavy computation, ML feature engineering
  • dbt — business logic transformations, data quality tests, documentation
  • Orchestration — Dagster/Airflow coordinates Spark jobs → dbt runs
# Spark: heavy lifting (ingestion, joins, aggregation)
# dbt/models/staging/stg_transactions.sql
WITH source AS (
 SELECT * FROM {{ source('raw', 'transactions') }}
),
cleaned AS (
 SELECT
 transaction_id,
 customer_id,
 CAST(amount AS DECIMAL(18,2)) AS amount,
 UPPER(currency) AS currency,
 DATE(transaction_ts) AS transaction_date,
 CASE 
 WHEN amount > 10000 THEN 'high_value'
 WHEN amount > 1000 THEN 'medium'
 ELSE 'standard'
 END AS value_tier
 FROM source
 WHERE transaction_id IS NOT NULL
)
SELECT * FROM cleaned

Data Quality Tests

dbt tests validate your data at every transformation step:

# dbt/models/staging/schema.yml
version: 2
models:
 - name: stg_transactions
 columns:
 - name: transaction_id
 tests:
 - unique
 - not_null
 - name: amount
 tests:
 - not_null
 - dbt_utils.accepted_range:
 min_value: 0
 max_value: 10000000
 - name: currency
 tests:
 - accepted_values:
 values: ['USD', 'EUR', 'GBP', 'JPY']

Lineage and Documentation

dbt auto-generates lineage graphs and documentation. Combined with Spark's execution plans, you get end-to-end visibility:

  • Column-level lineage — trace any metric back to its raw source
  • Impact analysis — understand downstream effects of schema changes
  • Run history — track freshness, execution time, and test results
Article Metadata

Review with Spaced Repetition

Add this lesson's 3 flashcards to your SM-2 study queue. They will appear when due in the Study Queue.

Feynman Concept Cards

Master each building block: read the ELI5, explore the analogy, work the example, find your gaps, teach it back, build it.

Data Quality is a concept in best practices. In simple terms, Data Quality covers best practices in Data Engineering. This data engineering concept addresses key topics in the best practices in data engineering domain. Also known as: data observability, data val

Analogy
Think of Data Quality like a maintenance checklist for a power plant — it helps you handle best practices tasks more effectively.
Example
Consider a scenario where Data Quality applies: Data Quality covers best practices in Data Engineering. This data engineering concept addresses key topics in the best practices in data engineering domain. Also known as: data observability, data val...
Find Gaps
What are the key components or steps involved in Data Quality?
Can you explain Data Quality without using jargon?
What happens if Data Quality is not applied correctly?
How does Data Quality relate to other concepts in best practices?
Teach Back

Explain Data Quality as if teaching a colleague who is new to best practices. Cover: what it is, how it works, and why it matters.

Create

Create a checklist that demonstrates Data Quality in a real-world best practices scenario. Walk through your design decisions.

Show solution
A checklist for Data Quality should include: 1. The core components of data quality 2. How they interact 3. Expected outcomes or outputs
Difficulty: Intermediate — 3/5

DataOps is a concept in best practices. In simple terms, DataOps covers best practices in Data Engineering. This data engineering concept addresses key topics in the best practices in data engineering domain. Also known as: DataOps practices, data operation

Analogy
Think of DataOps like a maintenance checklist for a power plant — it helps you handle best practices tasks more effectively.
Example
Consider a scenario where DataOps applies: DataOps covers best practices in Data Engineering. This data engineering concept addresses key topics in the best practices in data engineering domain. Also known as: DataOps practices, data operation...
Find Gaps
What are the key components or steps involved in DataOps?
Can you explain DataOps without using jargon?
What happens if DataOps is not applied correctly?
How does DataOps relate to other concepts in best practices?
Teach Back

Explain DataOps as if teaching a colleague who is new to best practices. Cover: what it is, how it works, and why it matters.

Create

Create a checklist that demonstrates DataOps in a real-world best practices scenario. Walk through your design decisions.

Show solution
A checklist for DataOps should include: 1. The core components of dataops 2. How they interact 3. Expected outcomes or outputs
Difficulty: Advanced — 4/5

Extract-Transform-Load is a concept in foundations. In simple terms, Extract-Transform-Load covers foundational knowledge in Data Engineering. This data engineering concept addresses key topics in the foundational knowledge in data engineering domain. Also known as: ET

Analogy
Think of Extract-Transform-Load like the foundation of a building — invisible but load-bearing — it helps you handle foundations tasks more effectively.
Example
Consider a scenario where Extract-Transform-Load applies: Extract-Transform-Load covers foundational knowledge in Data Engineering. This data engineering concept addresses key topics in the foundational knowledge in data engineering domain. Also known as: ET...
Find Gaps
What are the key components or steps involved in Extract-Transform-Load?
Can you explain Extract-Transform-Load without using jargon?
What happens if Extract-Transform-Load is not applied correctly?
How does Extract-Transform-Load relate to other concepts in foundations?
Teach Back

Explain Extract-Transform-Load as if teaching a colleague who is new to foundations. Cover: what it is, how it works, and why it matters.

Create

Create a diagram that demonstrates Extract-Transform-Load in a real-world foundations scenario. Walk through your design decisions.

Show solution
A diagram for Extract-Transform-Load should include: 1. The core components of etl 2. How they interact 3. Expected outcomes or outputs
Difficulty: Intermediate — 3/5

Dagster Orchestrator is a concept in advanced techniques. In simple terms, Dagster Orchestrator covers advanced techniques in Data Engineering. This data engineering concept addresses key topics in the advanced techniques in data engineering domain. Also known as: dagster. R

Analogy
Think of Dagster Orchestrator like a specialized tool in a data engineer's workshop — it helps you handle advanced techniques tasks more effectively.
Example
Consider a scenario where Dagster Orchestrator applies: Dagster Orchestrator covers advanced techniques in Data Engineering. This data engineering concept addresses key topics in the advanced techniques in data engineering domain. Also known as: dagster. R...
Find Gaps
What are the key components or steps involved in Dagster Orchestrator?
Can you explain Dagster Orchestrator without using jargon?
What happens if Dagster Orchestrator is not applied correctly?
How does Dagster Orchestrator relate to other concepts in advanced techniques?
Teach Back

Explain Dagster Orchestrator as if teaching a colleague who is new to advanced techniques. Cover: what it is, how it works, and why it matters.

Create

Create a diagram that demonstrates Dagster Orchestrator in a real-world advanced techniques scenario. Walk through your design decisions.

Show solution
A diagram for Dagster Orchestrator should include: 1. The core components of dagster 2. How they interact 3. Expected outcomes or outputs
Difficulty: Advanced — 4/5

ML Pipeline Engineering is a concept in advanced techniques. In simple terms, ML Pipeline Engineering covers advanced techniques in Data Engineering. This data engineering concept addresses key topics in the advanced techniques in data engineering domain. Also known as: MLOps,

Analogy
Think of ML Pipeline Engineering like a specialized tool in a data engineer's workshop — it helps you handle advanced techniques tasks more effectively.
Example
Consider a scenario where ML Pipeline Engineering applies: ML Pipeline Engineering covers advanced techniques in Data Engineering. This data engineering concept addresses key topics in the advanced techniques in data engineering domain. Also known as: MLOps, ...
Find Gaps
What are the key components or steps involved in ML Pipeline Engineering?
Can you explain ML Pipeline Engineering without using jargon?
What happens if ML Pipeline Engineering is not applied correctly?
How does ML Pipeline Engineering relate to other concepts in advanced techniques?
Teach Back

Explain ML Pipeline Engineering as if teaching a colleague who is new to advanced techniques. Cover: what it is, how it works, and why it matters.

Create

Create a diagram that demonstrates ML Pipeline Engineering in a real-world advanced techniques scenario. Walk through your design decisions.

Show solution
A diagram for ML Pipeline Engineering should include: 1. The core components of ml pipeline 2. How they interact 3. Expected outcomes or outputs
Difficulty: Advanced — 5/5

Feature Store is a concept in architecture. In simple terms, Feature Store covers architectural patterns for Data Engineering. This data engineering concept addresses key topics in the architectural patterns for data engineering domain. Also known as: ML featur

Analogy
Think of Feature Store like a blueprint for a complex machine — it helps you handle architecture tasks more effectively.
Example
Consider a scenario where Feature Store applies: Feature Store covers architectural patterns for Data Engineering. This data engineering concept addresses key topics in the architectural patterns for data engineering domain. Also known as: ML featur...
Find Gaps
What are the key components or steps involved in Feature Store?
Can you explain Feature Store without using jargon?
What happens if Feature Store is not applied correctly?
How does Feature Store relate to other concepts in architecture?
Teach Back

Explain Feature Store as if teaching a colleague who is new to architecture. Cover: what it is, how it works, and why it matters.

Create

Create a diagram that demonstrates Feature Store in a real-world architecture scenario. Walk through your design decisions.

Show solution
A diagram for Feature Store should include: 1. The core components of feature store 2. How they interact 3. Expected outcomes or outputs
Difficulty: Advanced — 4/5

Feynman Synthesis — Prove You Understand

1. The One-Pager

Explain this lesson's core idea to a smart 15-year-old. No jargon allowed.

2. The Gap Map

List 3 things you are still unsure about. Be specific.

Knowledge Check

Test your understanding of this lesson.

Flashcards

Space = flip · 1-4 = grade · Swipe on mobile

Related Research

Related Knowledge

Stay Updated

Get the latest research summaries delivered to your inbox.