From your first query to pipelines in production
199 in-depth lessons, most of them free: SQL and Python foundations, PySpark to Spark internals, the lakehouse and Structured Streaming, plus Airflow and dbt.
Foundations: SQL for data engineers
Write any query an interview asks for, and explain why it is right. The SQL that data engineering interviews test, in Spark SQL: filtering and NULL logic, aggregates, every kind of join, window functions, CTEs and dates, then gaps and islands, sessions, pivots and query plans. Every example is a query you can edit and run in your browser.
- SELECT, WHERE and ORDER BY · Bronze · 7 min read. Pick columns, keep the rows you need and sort them, and the order in which SQL actually runs each clause.
- NULL and three-valued logic · Bronze · 6 min read. Why NULL = NULL is not true, how WHERE quietly drops unknown rows, and the functions that handle NULL safely.
- CASE WHEN and expressions · Bronze · 6 min read. Label, bucket and clean values row by row with CASE, IF, COALESCE and arithmetic.
- GROUP BY and HAVING · Bronze · 6 min read. Collapse rows into one per group, filter groups with HAVING, and the rule for what SELECT may show.
- Conditional aggregates and COUNT DISTINCT · Bronze · 6 min read. Count and sum only some rows inside one GROUP BY with FILTER, CASE and count_if, and count unique values.
- Inner and outer joins · Bronze · 7 min read. Match rows across tables with INNER, LEFT, RIGHT and FULL joins, and see exactly which rows each one keeps.
- Semi and anti joins · Bronze · 7 min read. Find rows that have, or lack, a match with EXISTS and LEFT SEMI / ANTI JOIN, and why NOT IN returns nothing once a NULL sneaks in.
- Self joins · Bronze · 5 min read. Join a table to itself to compare its rows: who referred whom, pairs of orders, and duplicates that differ in one column.
- Window functions: ranking and top N · Silver · 7 min read. Keep every row while computing over a group, number rows with ROW_NUMBER, RANK and DENSE_RANK, and get the top N per group.
- LAG and LEAD · Silver · 6 min read. Compare each row with the previous or next one: changes, gaps between events and day-over-day growth.
- Running totals and window frames · Silver · 7 min read. Running totals, moving averages and percent of total, and the frame that decides which rows are added up.
- CTEs and subqueries · Silver · 6 min read. Write a long query as named steps with WITH, and use scalar and correlated subqueries where they fit.
- UNION, INTERSECT and EXCEPT · Silver · 6 min read. Stack, intersect and subtract query results, the rules they follow, and reconciling two sources.
- Dates and date spines · Silver · 6 min read. Weeks, months and date arithmetic, half-open ranges, and a calendar that keeps days with no data.
- Gaps and islands · Gold · 8 min read. Find streaks of consecutive days and runs of the same value with two reusable window tricks.
- Sessionization · Gold · 7 min read. Split a clickstream into sessions with an inactivity timeout, then measure each session.
- Pivot and unpivot · Gold · 6 min read. Turn rows into columns for reports and columns back into rows, with PIVOT, CASE WHEN, UNPIVOT and stack.
- Reading EXPLAIN · Gold · 8 min read. Read a query plan from the bottom up: scans and pushed filters, shuffles, join strategies, and why a query is slow.
Foundations: Python for data engineers
Answer the Python and DSA rounds of a data engineering interview with confidence. The Python that data engineering interviews test: what each data structure costs, comprehensions and collections, decorators and generators, classes and context managers, wrangling without pandas, and the algorithms behind heaps, windows, binary search and DAG scheduling.
- Dict, set and list methods · Bronze · 7 min read. get, setdefault, views, set operations, append versus extend, remove and slicing, with the traps in each.
- Strings and built-in functions · Bronze · 6 min read. split, join, strip, f-strings, zip, enumerate, any, all, min, max and sorted, and their surprises.
- Files, JSON, CSV and dates · Bronze · 8 min read. Read files line by line, JSON and CSV, ISO dates, strptime codes, time zones and zoneinfo.
- Lists, dicts and sets: what each operation costs · Bronze · 7 min read. Pick the container from the question, and why a set turns an hour-long loop into a second.
- Comprehensions · Bronze · 5 min read. List, dict and set comprehensions, filtering versus choosing, nesting, and generator expressions.
- Counter, defaultdict and deque · Bronze · 6 min read. Count, group and keep the last N with the collections module, and the traps in each.
- Sorting with key functions · Bronze · 5 min read. Tuple keys, mixed directions, stability and data with None in it.
- Mutability, copies and default arguments · Bronze · 4 min read. What assignment really does, shallow versus deep copies, and the mutable default trap.
- Functions, *args, **kwargs and closures · Bronze · 8 min read. Every kind of parameter, closures that remember state, nonlocal and late binding.
- Decorators · Silver · 8 min read. What @ does, wrappers for any function, functools.wraps, and decorators with arguments.
- Generators and lazy evaluation · Silver · 6 min read. yield, constant-memory pipelines, endless inputs and the one-pass rule.
- Iterators, yield from and itertools · Silver · 8 min read. The iterator protocol, re-iterable classes, recursive generators and the itertools you will use.
- Classes, properties and dataclasses · Silver · 4 min read. Invariants, validated and read-only attributes, alternate constructors and record types.
- Exceptions and context managers · Silver · 5 min read. try/except/else/finally, custom exceptions, with blocks, contextlib and logging.
- Wrangling data without pandas · Silver · 5 min read. Parse, flatten, deduplicate, join and aggregate in plain Python, with SQL's null rules.
- Dunder methods and abstract classes · Gold · 7 min read. Equality, ordering and hashing that agree, NotImplemented, and interfaces with abc.
- Heaps, top-k and k-way merges · Gold · 7 min read. heapq, top-k in O(n log k), tie-breaking tuples, and merging sorted streams.
- Sliding windows, sweeps and binary search · Gold · 5 min read. O(n) windows, sort-then-sweep for intervals, and bisect for as-of lookups.
- Graphs and topological sort · Gold · 7 min read. Dependency graphs, Kahn's algorithm, cycle detection and how schedulers use them.
- Big-O and performance for data engineers · Gold · 5 min read. Read complexity from code, find hidden quadratics, stream instead of loading, and measure.
Step 1: PySpark functions
Write any DataFrame transformation a job or an interview asks for. One function per lesson: what it does, how it works step by step, the gotchas, and every example in PySpark with its SQL equivalent.
- Reading and writing data · Bronze · 8 min read. Load CSV, JSON and Parquet with the right options and schema, and write with the right save mode and layout.
- select · Bronze · 6 min read. Choose, rename and compute columns, and why select beats a chain of withColumn calls.
- filter / where · Bronze · 5 min read. Keep the rows that match a condition, and the null and operator traps that silently drop data.
- withColumn · Bronze · 6 min read. Add or replace one column, and why calling it in a long loop slows Spark down.
- orderBy · Bronze · 4 min read. Sort rows ascending or descending, control where nulls go, and know what a global sort costs.
- cast and schemas · Bronze · 5 min read. Change column types safely, read a schema, and avoid the silent nulls bad casts produce.
- String functions · Bronze · 5 min read. concat vs concat_ws, substring, split, trim and padding, with the null traps in each.
- Parsing dates and timestamps · Bronze · 4 min read. to_date, to_timestamp and date_format patterns, and why yyyy and YYYY are not the same.
- when / otherwise · Bronze · 4 min read. CASE WHEN logic inside a column: first match wins, and a missing otherwise means null.
- fillna / dropna · Bronze · 4 min read. Fill or drop missing values per column, and why fillna(0) leaves string columns alone.
- groupBy + agg · Bronze · 4 min read. Aggregate rows per group: counts, sums, averages, and how count(*) differs from count(col).
- dropDuplicates · Bronze · 5 min read. Remove duplicate rows or keys, and why "keep the latest row" needs a window instead.
- join · Bronze · 5 min read. Combine DataFrames on a key: inner, left, right and full joins, and the duplicate-key fan-out trap.
- spark.sql and temp views · Bronze · 6 min read. Mix SQL and DataFrames: register views, run spark.sql, and pass parameters safely.
- row_number / rank · Silver · 4 min read. Number and rank rows inside a window, and how the three ranking functions treat ties.
- lag / lead · Silver · 4 min read. Read the previous or next row in a window to compute changes, gaps and streaks.
- max_by / min_by · Silver · 4 min read. Return the value from the row where another column is largest or smallest, in one aggregate.
- percentile_approx · Silver · 4 min read. Medians and p90s that scale to billions of rows, and how the accuracy setting trades memory for error.
- explode · Silver · 4 min read. Turn each array element into its own row, and the rows explode silently drops.
- posexplode · Silver · 3 min read. Explode an array and keep each element position, plus the _outer variant that keeps empty arrays.
- collect_list / collect_set · Silver · 4 min read. Gather the values of a group into an array, with or without duplicates, and in which order.
- Array functions · Silver · 4 min read. array_contains, size, element_at, sort_array and the set functions, without exploding.
- JSON and structs · Silver · 6 min read. Parse JSON strings with from_json, reach into nested fields, and flatten structs.
- coalesce · Silver · 4 min read. Take the first non-null value from several columns, and why it is not the same as fillna.
- left_semi / left_anti · Silver · 4 min read. Keep the rows that have a match, or the rows that do not, without duplicating anything.
- eqNullSafe (<=>) · Silver · 4 min read. Equality where null matches null: the fix for joins and comparisons that silently drop null keys.
- pivot · Silver · 5 min read. Turn row values into columns, and why passing the values list up front makes it faster.
- trunc / add_months · Silver · 4 min read. Truncate dates to the month or year and shift them by whole months, including month-end rules.
- Regular expressions from zero · Silver · 8 min read. What a regex is, the dozen symbols behind almost every pattern, and how to read and build one piece by piece.
- regexp_extract · Silver · 8 min read. Extract, filter, replace and collect with a regular expression, and what you get when nothing matches.
- UDFs and pandas UDFs · Silver · 7 min read. When a Python function is the only way, how to write it, and why built-ins are much faster.
- Testing PySpark code · Silver · 6 min read. Unit test transformations with a local SparkSession and assertDataFrameEqual, and the cases worth covering.
- rangeBetween · Gold · 6 min read. Window frames by value instead of row count: the last 7 calendar days, not the last 7 rows.
- last(ignorenulls) · Gold · 4 min read. Forward-fill missing values with last over a window, and the frame that makes it work.
- Gaps and islands · Gold · 7 min read. Streaks, sessions and status runs: one window pattern behind many interview questions.
- rollup / cube · Gold · 4 min read. Subtotals and grand totals in one pass, and how grouping() tells a total row from a real null.
- unpivot · Gold · 3 min read. Turn columns into rows (wide to long) with unpivot or the SQL stack() function.
- unionByName · Gold · 4 min read. Stack DataFrames by column name instead of position, and survive schema drift with allowMissingColumns.
Step 2: Spark internals
Explain why a batch job is slow, and make it fast. How Spark executes your batch jobs, the configs that change it, and what is new in Spark 4.0. Every lesson ends with a quick check.
- Run Spark on your laptop · Bronze · 7 min read. Set up a real Spark session in minutes, with Delta Lake, Iceberg or Spark Connect, for the hands-on labs.
- Driver, executors and the cluster manager · Bronze · 7 min read. Who plans the work, who does it, and who hands out the machines in a Spark application.
- Transformations vs actions · Bronze · 6 min read. Why nothing runs until you call an action, and what lazy evaluation buys Spark.
- RDDs, DataFrames and Datasets · Bronze · 5 min read. The three Spark APIs, what Catalyst can and cannot optimise, and when an RDD still makes sense.
- Why DataFrames are faster than RDDs · Bronze · 8 min read. Column pruning, pushdown, no Python round trip, Tungsten rows and code generation: five reasons, and how one lambda switches them off.
- Partitions · Bronze · 7 min read. The unit of parallelism in Spark: where partitions come from and why their number matters.
- Jobs, stages and tasks · Bronze · 7 min read. How one action becomes a DAG of stages split at shuffles, and how to read it in the Spark UI.
- Narrow vs wide transformations · Silver · 6 min read. Which operations move data across the network, and why the shuffle is the most expensive step.
- Shuffle partitions · Silver · 5 min read. The default of 200 shuffle partitions, and how to size them for your data.
- Join strategies · Silver · 8 min read. Broadcast hash, shuffle hash, sort-merge and nested loop joins: how Spark picks one, and how to steer it.
- Join hints and slow non-equi joins · Silver · 6 min read. Steer the join strategy with hints, rewrite a join that fell back to a nested loop, and check what Spark really ran.
- Broadcast joins · Silver · 6 min read. Ship a small table to every executor and skip the shuffle, and when broadcasting backfires.
- Caching and persistence · Silver · 6 min read. cache(), persist() and storage levels: when caching speeds a job up and when it hurts.
- Broadcast variables and accumulators · Silver · 7 min read. Why driver variables never change inside tasks, and the two shared variables Spark offers instead.
- Dynamic allocation · Silver · 6 min read. Add and remove executors with the workload, and keep shuffle files safe while executors come and go.
- Adaptive Query Execution · Silver · 7 min read. Spark re-plans a running query from real statistics: coalescing, join switching and skew splitting.
- The small file problem · Silver · 8 min read. Why thousands of tiny files slow every read, how Spark jobs create them, and how to prevent and fix them.
- Data skew and salting · Gold · 8 min read. Why one task runs for an hour while the rest finish in seconds, and how salting spreads a hot key.
- AQE skew-join handling · Gold · 6 min read. How Spark detects oversized partitions in sort-merge joins and splits them automatically.
- Catalyst and physical plans · Gold · 6 min read. Read explain() output: parsed, analyzed and optimized plans, and the physical plan Spark runs.
- The memory model · Gold · 7 min read. Execution vs storage memory, overhead, and what really causes spills and out-of-memory errors.
- Shuffle internals · Gold · 8 min read. Map output files, block fetches, fetch failures and the external shuffle service.
- How aggregations execute · Gold · 7 min read. Partial and final aggregation, hash vs sort aggregation, and why COUNT(DISTINCT) costs more.
- Serialization: Java, Kryo, Tungsten and Arrow · Gold · 7 min read. Where Spark serializes data and code, and which serializer matters for RDDs, DataFrames and Python.
- Dynamic partition pruning · Gold · 6 min read. Skip whole partitions of a fact table at runtime using a filter on the dimension it joins to.
- Bucketing · Gold · 6 min read. Pre-shuffle tables into buckets so joins and aggregations on the key skip the shuffle.
- Spark Connect · Gold · 5 min read. A thin client that talks to a remote Spark server over gRPC, and what it changes for applications.
- ANSI mode by default · Gold · 5 min read. Spark 4.0 turns ANSI SQL on: overflows and invalid casts now raise errors instead of returning null.
- The VARIANT type · Gold · 6 min read. Store and query semi-structured JSON efficiently without declaring a schema up front.
- SQL pipe syntax · Gold · 5 min read. Write SQL top to bottom with the |> operator, in the order the query actually runs.
- Python Data Source API · Gold · 6 min read. Write custom batch and streaming readers and writers for Spark in pure Python.
Step 3: Data lake & lakehouse
Design reliable tables on object storage with Delta Lake, Iceberg and Hudi. From data lake basics (file formats, folder layout, partitioning) to Delta Lake, Apache Iceberg and Apache Hudi: how table formats bring transactions to object storage, and how to run them.
- Lake, warehouse, lakehouse · Bronze · 6 min read. What data lakes and warehouses each get right, and what the lakehouse borrows from both.
- Data lake storage: formats and layout · Bronze · 7 min read. CSV, JSON, Avro, ORC and Parquet compared, compression, and how to lay out folders in a data lake.
- Parquet and columnar storage · Bronze · 7 min read. Row groups, column chunks and statistics: why columnar files let engines skip most of the data.
- Open table formats · Bronze · 6 min read. Delta Lake, Iceberg and Hudi: a metadata layer that turns a folder of Parquet files into a table.
- ACID on object storage · Bronze · 7 min read. Why plain Parquet folders break under concurrent writes and failures, and how table formats fix it.
- The medallion architecture · Bronze · 6 min read. Bronze, silver and gold layers: what belongs in each, and where the pattern goes wrong.
- The Delta transaction log · Silver · 8 min read. Commit files, checkpoints and optimistic concurrency: how the _delta_log turns files into a table.
- Time travel and RESTORE · Silver · 5 min read. Query or roll back to any earlier version of a table, and what retention does to that promise.
- Schema enforcement and evolution · Silver · 6 min read. What a table rejects on write, how mergeSchema adds columns, and which changes are safe.
- Constraints and generated columns · Silver · 6 min read. NOT NULL and CHECK constraints, generated columns and identity columns in Delta tables.
- MERGE INTO and upserts · Silver · 7 min read. Matched, not-matched and not-matched-by-source clauses, step by step, and the duplicate-source error.
- Slowly changing dimensions (SCD Type 2) · Silver · 8 min read. Keep the full history of a dimension with one MERGE per batch, and the edge cases that break it.
- Change Data Feed · Silver · 5 min read. Read the row-level inserts, updates and deletes made to a Delta table between two versions.
- Partitioning done right · Silver · 6 min read. When to partition a table, how to choose the column, and how over-partitioning backfires.
- Compaction, OPTIMIZE and Z-order · Silver · 5 min read. Rewrite small files into large ones and cluster data so queries skip more of it.
- VACUUM and retention · Silver · 6 min read. Delete old data files safely without breaking running readers or time travel.
- Iceberg metadata tree · Gold · 6 min read. Metadata files, snapshots, manifest lists and manifests, and how query planning uses them.
- Hidden partitioning and partition evolution · Gold · 6 min read. Iceberg partition transforms, and changing a table layout without rewriting its data.
- Copy-on-write vs merge-on-read · Gold · 6 min read. Two ways to apply updates and deletes, and which one fits a given workload.
- Apache Hudi: keys, indexes and table services · Gold · 7 min read. Record keys, COW and MOR tables, the index, the timeline, and when Hudi is the right choice.
- Deletion vectors · Gold · 5 min read. Mark rows as deleted without rewriting whole files, and the cost readers pay for it.
- Liquid clustering · Gold · 5 min read. Incremental clustering in Delta Lake that replaces fixed partitions and Z-order.
- Concurrency and conflicts · Gold · 6 min read. Optimistic concurrency, the conflicts that fail a commit, and how to design writers around them.
- Branches, tags and write-audit-publish · Gold · 7 min read. Stage a write on an Iceberg branch, check it, then publish atomically, and the Delta equivalents.
- Catalogs: Unity, Polaris, Iceberg REST · Gold · 5 min read. What a catalog does for a lakehouse, and the open catalogs that arrived in 2024 and 2025.
- Format interoperability · Gold · 5 min read. Delta UniForm and Apache XTable: one copy of the data, readable as Delta, Iceberg or Hudi.
- Iceberg format v3 · Gold · 5 min read. Deletion vectors, row lineage, default values and VARIANT: what the v3 table spec adds.
- Delta Lake 4.0 · Gold · 5 min read. VARIANT, type widening, collations and the other changes that shipped alongside Spark 4.0.
Step 4: Structured Streaming
Build pipelines that process data as it arrives, exactly once. Learn streaming from the first question, whether you need a stream at all, to running one in production. Every lesson starts in plain words: sources, triggers and checkpoints, Kafka from topics to Kafka 4, windows and late data, exactly-once from end to end, ordering and bad records, joins and custom state, backpressure, recovery, and the same ideas on Google Cloud.
- Batch, micro-batch or streaming? · Bronze · 6 min read. Three ways to process data, what fresher data costs, and a checklist for choosing in a system design interview.
- Structured Streaming basics · Bronze · 8 min read. Streams as an unbounded table: sources, sinks, triggers, output modes and checkpoints.
- Sources and sinks · Bronze · 8 min read. Which sources can replay data, how Kafka and file sources track their position, and which sinks are exactly-once.
- foreachBatch: write a stream anywhere · Bronze · 7 min read. Hand each micro-batch to your own code as a normal DataFrame, and the four rules that keep the writes correct.
- Triggers · Bronze · 7 min read. When micro-batches run, what happens when one overruns, and availableNow for scheduled incremental jobs.
- Output modes: append, update, complete · Bronze · 6 min read. What each mode writes after a batch, which queries allow which mode, and what the sink must support.
- Checkpoints and state stores · Bronze · 7 min read. What a checkpoint holds, how state is partitioned and stored, RocksDB, and reading state as a table.
- Kafka in plain words · Bronze · 8 min read. Topics, partitions, offsets, brokers and retention: why Kafka is a log that keeps messages, not a queue that deletes them.
- Consumer groups and offsets · Bronze · 7 min read. How a group shares partitions, rebalances, committed offsets and lag, and why Spark keeps its offsets in the checkpoint instead.
- Watermarks and late data · Silver · 8 min read. Event time vs processing time, how watermarks bound state, and what happens to late rows.
- Event-time windows · Silver · 7 min read. Tumbling, sliding and session windows, what they cost in state, and when a window is final.
- Deduplicating a stream · Silver · 7 min read. Where duplicates come from, dropDuplicatesWithinWatermark, and deduplicating at the sink.
- Streaming into Delta tables · Silver · 7 min read. Write a stream into a Delta table exactly once, and read a Delta table as a stream.
- Incremental file ingestion · Silver · 7 min read. Load each new file exactly once: the streaming file source, Auto Loader, COPY INTO, schema drift and backfills.
- Kafka producers: acks, retries and batching · Silver · 7 min read. How the key picks a partition, what acks and the idempotent producer protect against, batching and compression, and writing to Kafka from Spark.
- Schemas and Schema Registry · Silver · 7 min read. JSON, Avro or Protobuf, compatibility modes and who upgrades first, and decoding registry messages in Spark.
- Delivery guarantees end to end · Silver · 9 min read. At-most-once, at-least-once and exactly-once, why most hops are at-least-once, and how idempotent sinks and event ids give exactly-once results.
- Ordering and out-of-order events · Silver · 7 min read. What order Kafka really guarantees, why global order is expensive, and how event time and sequence numbers put events back in order.
- Bad records and dead-letter queues · Silver · 10 min read. Split valid and invalid rows in foreachBatch, keep bad ones with the reason they failed, alert on the rate and replay them after a fix.
- Stream joins · Gold · 7 min read. Stream-static enrichment, stream-stream joins bounded by watermarks, and why outer joins emit late.
- Custom state with transformWithState · Gold · 6 min read. Typed state per key, timers and TTL for rules that windows and joins cannot express.
- Monitoring streams · Gold · 6 min read. The progress report, the four signals worth an alert, listeners and the Spark UI.
- Backpressure and rate limits · Gold · 8 min read. When data arrives faster than a stream processes it: measuring lag, catch-up arithmetic, rate limits per source, and what to scale.
- Restarts, query changes and reprocessing · Gold · 7 min read. Which changes a checkpoint accepts, how to rebuild a stateful query safely, and source schema changes.
- Kafka in production · Gold · 7 min read. Replication, min.insync.replicas and acks=all, choosing a partition count, compacted topics, and transactions with read_committed.
- Kafka 4: KRaft, new rebalances and queues · Gold · 6 min read. ZooKeeper removed, the broker-driven consumer rebalance protocol, share groups, and what changed for Spark jobs.
- Streaming on Google Cloud · Gold · 8 min read. Pub/Sub, Dataflow (Apache Beam) and BigQuery, mapped to the Spark ideas: windows, watermarks, allowed lateness, triggers, exactly-once, dead letters and ordering.
Pipelines in production: Airflow
Schedule, retry and backfill pipelines so they run unattended. Run pipelines on a schedule with Apache Airflow 3: DAG files, schedules and catchup, templates and idempotent reruns, retries and trigger rules, branching, XCom, sensors, dynamic tasks and task groups. Every example shows what the scheduler does with it.
- What Airflow is (and is not) · Bronze · 5 min read. An orchestrator: what it schedules, retries and records, how it differs from cron, and what Airflow 3 is made of.
- A DAG file, line by line · Bronze · 5 min read. The DAG, its tasks and dependencies, and why the file runs every time it is parsed.
- Running Airflow 3 on your laptop · Bronze · 5 min read. airflow standalone, the dags folder, the UI, and testing a DAG with airflow dags test.
- Schedules and logical dates · Bronze · 5 min read. Cron strings, presets and timetables, and what a run's logical date means in Airflow 3.
- Catchup, backfill and end_date · Bronze · 5 min read. Which runs a late deploy creates, filling history on purpose, and limiting runs in flight.
- Operators and TaskFlow · Bronze · 5 min read. BashOperator, PythonOperator and @task: when to use which, and where providers come in.
- Templates and idempotent reruns · Bronze · 5 min read. Jinja in task arguments, the context Airflow 3 provides, macros, and reruns that redo the same day.
- Retries, timeouts and callbacks · Silver · 5 min read. Which failures to retry, how retry_delay and backoff space them, timeouts, and failing fast.
- Trigger rules and run state · Silver · 5 min read. When a task runs after its upstream tasks fail or skip, and how a run gets its final state.
- Branching and short-circuiting · Silver · 4 min read. Choose a path at run time, skip the rest, and join the branches back together.
- XCom: passing data between tasks · Silver · 4 min read. Return values, TaskFlow arguments and xcom_pull, and what should never go through XCom.
- Sensors and deferrable operators · Silver · 5 min read. Wait for a file, a partition or another DAG without blocking a worker slot.
- Dynamic task mapping · Silver · 4 min read. One task per file, table or customer, decided at run time with expand().
- Task groups, setup and teardown · Silver · 5 min read. Organise a large DAG into groups, and pair resources with their clean-up.
- Assets: scheduling on data · Gold · 5 min read. Start a DAG when the data it needs has been updated, instead of at a guessed time.
- Idempotent pipelines with Spark and Delta · Gold · 5 min read. Jobs that a retry, rerun or backfill cannot corrupt, and chains of days that stop at a failure.
- Pools, concurrency and priority · Gold · 5 min read. Every limit on how many tasks run at once, pools for shared systems, and who goes first.
- Airflow 3 architecture in production · Gold · 4 min read. The life of a task instance, executors, DAG bundles and versions, and what production needs.
- Testing DAGs and CI/CD · Gold · 4 min read. Import, policy, unit and end-to-end tests, and a deploy pipeline for DAG repositories.
- Migrating from Airflow 2 to 3 · Gold · 5 min read. What breaks, what still works with a warning, and what changes without any error.
Pipelines in production: dbt
Ship tested warehouse transformations the way analytics teams do. Build warehouse transformations the way teams ship them: sources and refs, materializations, tests, Jinja and macros, incremental models, snapshots and CI.
- What dbt is (and is not) · Bronze · 6 min read. The T in ELT: models are SELECT statements, dbt compiles them and the warehouse runs them.
- A dbt project, file by file · Bronze · 5 min read. dbt_project.yml, profiles and targets, and the staging, intermediate and marts layout teams use.
- Sources and staging models · Bronze · 5 min read. Declare raw tables with source(), check their freshness, and clean them once in a staging model.
- ref() and the DAG · Bronze · 5 min read. How ref() builds the dependency graph, picks the right schema per environment, and drives node selection.
- Materializations · Bronze · 5 min read. View, table, ephemeral, incremental and materialized view: what each builds and when to pick it.
- Data tests · Bronze · 5 min read. unique, not_null, accepted_values and relationships, singular tests, and how a test fails: it returns rows.
- Jinja in dbt · Silver · 5 min read. Expressions, statements, loops and set: write SQL that writes SQL, and read what it compiles to.
- var(), target and environments · Silver · 4 min read. Parameterise a model with vars, and make dev builds smaller and safer than prod with target.
- Macros and custom generic tests · Silver · 5 min read. Reusable SQL with arguments and defaults, and your own generic tests built the same way.
- Packages and dbt_utils · Silver · 4 min read. packages.yml, dbt deps, and the dbt_utils macros interviews expect you to know, starting with surrogate keys.
- Incremental models · Silver · 5 min read. is_incremental(), {{ this }} and unique_key: process only new rows, and the first-run and re-run cases.
- Snapshots (SCD Type 2) · Silver · 5 min read. Record how mutable source rows change over time with the timestamp and check strategies.
- Unit tests · Silver · 5 min read. Test a model's logic on fixed input rows before it builds, and how unit tests differ from data tests.
- Incremental strategies · Gold · 6 min read. append, merge, delete+insert, insert_overwrite and microbatch: what each runs and which one fits.
- Late data and idempotent incrementals · Gold · 5 min read. Lookback windows, re-runs that give the same answer, schema changes and when to full refresh.
- Slim CI, state and defer · Gold · 5 min read. Build and test only what a pull request changed with state:modified+, --defer and dbt clone.
- Contracts, versions and access · Gold · 5 min read. Guarantee a model's columns and types, version breaking changes, and control who may ref a model.