This page requires JavaScript to display.
T
Unpacking...
← Advanced Data Engineering
Advanced Data Engineering

Data Engineering Tools

The tools data engineers use daily, explained from the inside: integration and orchestration, cloud warehouses and lakehouses, distributed storage, processing and streaming.

Contents
1. The Tool Landscape 2. dbt 3. Apache Airflow 4. Fivetran 5. Snowflake 6. Google BigQuery 7. Databricks 8. Hadoop Distributed File System (HDFS) 9. Apache Spark 10. Apache Kafka

1. The Tool Landscape

Data engineering tools fall into a few jobs. Knowing which job each tool does matters more than memorising features, because stacks change while the jobs stay the same.

JobTools on this pageAlternatives
Move data in (EL)FivetranAirbyte, Stitch, ADF, AWS DMS, Debezium
Transformdbt, SparkSQL, Lakeflow Declarative Pipelines, Dataflow
OrchestrateAirflowDagster, Prefect, Lakeflow Jobs, Step Functions
Store and querySnowflake, BigQuery, Databricks, HDFSRedshift, Synapse, Fabric, ClickHouse
StreamKafkaKinesis, Event Hubs, Pub/Sub, Pulsar
 SaaS + DBs --Fivetran--> Snowflake / BigQuery / Databricks <--dbt-- transformations
 events -----Kafka------> Spark / Flink streaming ---> lakehouse tables
                     Airflow schedules and monitors every step

2. dbt

dbt (data build tool) lets analysts and engineers build warehouse tables from SELECT statements, with software practices: version control, tests, documentation, environments and CI. dbt does not move data in; it transforms data already in the warehouse (the T in ELT).

ConceptWhat it is
ModelA SELECT in a .sql file; dbt creates a view or table from it
ref() / source()Declare dependencies; dbt builds the DAG and runs models in order
Materializationview, table, incremental, ephemeral, materialized view
Testsunique, not_null, accepted_values, relationships, plus custom SQL tests
SnapshotsSCD Type 2 history of a source table
ContractsEnforced column names and types for public models
Docs and lineageGenerated website with the model graph
-- models/staging/stg_orders.sql
SELECT order_id, customer_id, CAST(order_ts AS DATE) AS order_date,
       amount, UPPER(status) AS status
FROM {{ source('shop', 'orders') }}

-- models/marts/fct_customer_revenue.sql
SELECT customer_id, COUNT(*) AS orders, SUM(amount) AS revenue
FROM {{ ref('stg_orders') }}
WHERE status = 'DELIVERED'
GROUP BY customer_id
dbt build --select +fct_customer_revenue  # run upstream models, then tests, in dependency order
dbt docs generate && dbt docs serve  # browse documentation and lineage

dbt project: follows the official syntax but was not executed here, because it needs a live cloud account or service.

Deep dive: the dbt guide covers this in more depth.

Say this in the interview

"dbt is the transformation layer of ELT: SELECT statements become tables and views, ref() builds the dependency graph, and tests, snapshots, contracts and docs bring software engineering to SQL. It runs inside the warehouse, so it scales with Snowflake, BigQuery or Databricks compute."

3. Apache Airflow

Airflow orchestrates workflows defined as Python code. A DAG (directed acyclic graph) lists tasks and their dependencies; the scheduler runs each task when its upstream tasks succeed, with retries, alerts, backfills and a UI showing every run.

ConceptMeaning
DAGA workflow: tasks plus dependencies, with a schedule
Task / operatorOne unit of work: run SQL, a Spark job, a Python function, a dbt command
Data intervalThe period a run is responsible for (e.g. yesterday), exposed as ds
SensorWaits for a condition: a file, a partition, another DAG
XComSmall values passed between tasks (not datasets)
Assets (datasets)Schedule a DAG when an upstream asset is updated
ExecutorWhere tasks run: Local, Celery, Kubernetes

Airflow's core idea, running tasks in dependency order, is a topological sort of a DAG. This simulation shows the scheduler's logic:

from graphlib import TopologicalSorter

dag = {                                  # task: upstream tasks
    "extract_orders": set(), "extract_customers": set(),
    "load_bronze": {"extract_orders", "extract_customers"},
    "dbt_build": {"load_bronze"},
    "quality_checks": {"dbt_build"},
    "refresh_dashboard": {"quality_checks"}, "notify": {"quality_checks"},
}
ts = TopologicalSorter(dag)
ts.prepare()
wave = 1
while ts.is_active():
    ready = sorted(ts.get_ready())  # tasks whose upstreams all succeeded
    print(f"wave {wave}: run in parallel -> {ready}")
    ts.done(*ready)
    wave += 1
Output
wave 1: run in parallel -> ['extract_customers', 'extract_orders']
wave 2: run in parallel -> ['load_bronze']
wave 3: run in parallel -> ['dbt_build']
wave 4: run in parallel -> ['quality_checks']
wave 5: run in parallel -> ['notify', 'refresh_dashboard']
from datetime import datetime, timedelta
from airflow.decorators import dag, task

@dag(schedule="@daily", start_date=datetime(2026, 1, 1), catchup=False,
     default_args={"retries": 2, "retry_delay": timedelta(minutes=5)})
def orders_pipeline():
    @task
    def extract(ds=None):
        return f"s3://landing/orders/{ds}/"  # path for this data interval

    @task
    def load(path: str):
        print(f"loading {path}")

    load(extract())

orders_pipeline()

Airflow DAG: follows the official syntax but was not executed here, because it needs a live cloud account or service.

Deep dive: the Apache Airflow guide covers this in more depth.

Say this in the interview

"Airflow orchestrates pipelines as Python DAGs: the scheduler runs tasks in topological order once upstream tasks succeed, with retries, backfills by data interval, sensors and alerts. I keep tasks idempotent and parameterised by the data interval, pass only small values through XCom, and let Spark or the warehouse do the heavy processing."

4. Fivetran

Fivetran is a managed extract-and-load service. You pick a source (Salesforce, PostgreSQL, Stripe, Google Ads ... hundreds of connectors) and a destination (Snowflake, BigQuery, Databricks, Redshift); Fivetran handles authentication, schema discovery, incremental sync, schema changes and retries.

FeatureHow it works
Incremental syncLog-based CDC for databases, cursor fields or webhooks for APIs
Schema driftNew columns and tables added automatically (configurable)
History modeKeeps SCD Type 2-style history of source rows
PricingBased on monthly active rows (rows inserted, updated or deleted)
TransformationsIntegrates with dbt to transform after loading
ChooseWhen
FivetranMany SaaS sources, small team, want zero connector maintenance, budget available
Airbyte (open source or cloud)Lower cost, need custom connectors or self-hosting
Custom code (Python, Spark)Unusual APIs, very high volume where row-based pricing is expensive
Native CDC (Debezium, DMS)Low-latency database replication into Kafka or a lake
Say this in the interview

"Fivetran is managed EL: hundreds of maintained connectors with incremental sync, CDC and schema-drift handling, priced on monthly active rows. I use it when connector maintenance would cost more engineering time than the licence, and pair it with dbt for transformations. For very high volumes or unusual sources I compare with Airbyte, Debezium or custom ingestion."

5. Snowflake

Snowflake is a cloud data warehouse built on a three-layer architecture that separates storage from compute: many independent compute clusters can query the same data without competing.

 CLOUD SERVICES   authentication, metadata, query optimiser, transactions, security
 COMPUTE          virtual warehouses (XS ... 6XL), each an independent cluster; auto-suspend / resume
 STORAGE          compressed columnar micro-partitions (50-500 MB uncompressed) in cloud object storage
FeatureWhy it matters
Virtual warehousesSeparate compute for ETL, BI and data science; scale up for big queries, out (multi-cluster) for concurrency
Micro-partitions + pruningMin/max metadata per micro-partition skips data; clustering keys improve it
Time Travel and Fail-safeQuery or restore past data (up to 90 days on Enterprise)
Zero-copy cloningClone a database instantly for testing; storage shared until changed
Snowpipe / Streams and Tasks / Dynamic TablesContinuous loading and incremental transformation
Secure data sharingShare live tables with other accounts without copying
Iceberg tablesStore data as open Iceberg tables in your own storage
CREATE WAREHOUSE etl_wh WAREHOUSE_SIZE = 'MEDIUM' AUTO_SUSPEND = 60 AUTO_RESUME = TRUE;

COPY INTO raw.orders FROM @landing_stage/orders/
  FILE_FORMAT = (TYPE = PARQUET) MATCH_BY_COLUMN_NAME = CASE_INSENSITIVE;

CREATE TABLE dev_db CLONE prod_db;                         -- instant, zero-copy
SELECT * FROM orders AT (OFFSET => -60*60);                -- the table as it was an hour ago

CREATE DYNAMIC TABLE daily_revenue TARGET_LAG = '15 minutes' WAREHOUSE = etl_wh AS
  SELECT order_date, SUM(amount) AS revenue FROM orders GROUP BY order_date;

Snowflake SQL: follows the official syntax but was not executed here, because it needs a live cloud account or service.

Say this in the interview

"Snowflake separates storage, compute and services: data sits in compressed micro-partitions in cloud storage, and independent virtual warehouses query it, so ETL and BI never compete. Pruning on micro-partition metadata replaces indexes. I use auto-suspend for cost, zero-copy clones for testing, Time Travel for recovery, and Snowpipe, Streams and Tasks or Dynamic Tables for incremental pipelines."

6. Google BigQuery

BigQuery is Google Cloud's serverless warehouse: no clusters to size. Storage is columnar (Capacitor) on Google's distributed file system; queries run on a shared pool of compute units called slots (Dremel engine).

FeatureDetail
PricingOn-demand per TB scanned, or capacity (slot reservations); storage billed separately
PartitioningBy ingestion time, a DATE/TIMESTAMP column or an integer range; prunes scanned data
ClusteringSorts data within partitions by up to four columns; prunes further
Nested and repeated fieldsSTRUCT and ARRAY columns: denormalise without joins
StreamingStorage Write API for real-time ingestion
BigQuery MLTrain and run models with SQL
CREATE TABLE shop.orders (
  order_id STRING, customer_id STRING, order_ts TIMESTAMP, amount NUMERIC,
  items ARRAY<STRUCT<sku STRING, qty INT64, price NUMERIC>>
)
PARTITION BY DATE(order_ts)
CLUSTER BY customer_id
OPTIONS (partition_expiration_days = 730, require_partition_filter = TRUE);

-- unnest repeated items; the partition filter limits bytes scanned (and cost)
SELECT i.sku, SUM(i.qty * i.price) AS revenue
FROM shop.orders, UNNEST(items) AS i
WHERE DATE(order_ts) BETWEEN '2026-03-01' AND '2026-03-31'
GROUP BY i.sku;

BigQuery SQL: follows the official syntax but was not executed here, because it needs a live cloud account or service.

Cost control in BigQuery is query design: select only needed columns (columnar billing), always filter on the partition column (enforce it with require_partition_filter), cluster on common filters, and preview cost with a dry run.

Say this in the interview

"BigQuery is serverless: storage is columnar and compute is slots allocated per query, billed per TB scanned or by reservation. I partition by date, cluster by common filters, require partition filters, use nested and repeated fields instead of joins where it fits, and avoid SELECT * because billing follows columns read."

7. Databricks

Databricks is a lakehouse platform built around Apache Spark and Delta Lake. Data lives in your cloud storage as open Delta tables; Databricks adds managed Spark compute, SQL warehouses, notebooks, jobs, ML tooling and Unity Catalog for governance.

ComponentRole
Delta LakeACID tables on Parquet with a transaction log: MERGE, time travel, schema enforcement
Unity CatalogOne governance layer: catalogs, permissions, lineage, tags, audit
Auto LoaderIncremental file ingestion with schema tracking
Lakeflow Declarative PipelinesDeclarative batch and streaming pipelines with data quality expectations
Lakeflow JobsOrchestration of notebooks, pipelines and SQL
Databricks SQLSQL warehouses (including serverless) for BI
MLflow / Mosaic AIExperiment tracking, model registry, serving, GenAI

Delta Lake in action: MERGE and time travel

orders = spark.createDataFrame([(1, "NEW", 100.0), (2, "NEW", 80.0)], "order_id INT, status STRING, amount DOUBLE")
orders.write.format("delta").saveAsTable("orders")  # version 0

updates = spark.createDataFrame([(2, "SHIPPED", 80.0), (3, "NEW", 50.0)], "order_id INT, status STRING, amount DOUBLE")
updates.createOrReplaceTempView("updates")
spark.sql("""
  MERGE INTO orders t USING updates s ON t.order_id = s.order_id
  WHEN MATCHED THEN UPDATE SET *
  WHEN NOT MATCHED THEN INSERT *""")  # version 1

spark.table("orders").orderBy("order_id").show()
print("version 0 had", spark.read.option("versionAsOf", 0).table("orders").count(), "rows")
spark.sql("DESCRIBE HISTORY orders").select("version", "operation").orderBy("version").show()
Output
+--------+-------+------+
|order_id| status|amount|
+--------+-------+------+
|       1|    NEW| 100.0|
|       2|SHIPPED|  80.0|
|       3|    NEW|  50.0|
+--------+-------+------+

version 0 had 2 rows
+-------+--------------------+
|version|           operation|
+-------+--------------------+
|      0|CREATE TABLE AS S...|
|      1|               MERGE|
+-------+--------------------+
# Auto Loader on Databricks: ingest only new files, track schema changes
(spark.readStream.format("cloudFiles")
   .option("cloudFiles.format", "json")
   .option("cloudFiles.schemaLocation", "/Volumes/prod/raw/_schemas/orders")
   .load("/Volumes/prod/raw/landing/orders/")
   .writeStream.option("checkpointLocation", "/Volumes/prod/raw/_chk/orders")
   .trigger(availableNow=True)
   .toTable("prod.bronze.orders"))

Auto Loader (Databricks-only): follows the official syntax but was not executed here, because it needs a live cloud account or service.

Deep dive: the Spark & Databricks guide covers this in more depth.

Say this in the interview

"Databricks is a lakehouse: open Delta tables in my own cloud storage, with managed Spark, SQL warehouses, Auto Loader and declarative pipelines for ingestion, Jobs for orchestration and Unity Catalog for governance. Delta gives ACID MERGE, time travel and schema enforcement, so one copy of data serves both BI and ML."

8. Hadoop Distributed File System (HDFS)

HDFS stores very large files across a cluster of commodity machines. It splits files into large blocks (128 MB by default), stores each block on several DataNodes (replication factor 3 by default), and keeps the file-to-block map in the NameNode. Hardware failure is expected, so the system re-replicates lost blocks automatically.

           NameNode (metadata: file -> blocks -> DataNodes)   + Standby NameNode (HA)
              |  heartbeats and block reports every few seconds
 rack 1: DataNode1  DataNode2      rack 2: DataNode3  DataNode4
 block A: DN1, DN3, DN4   (default placement: one replica on the writer's rack,
                           two on a different rack -> survives a rack failure)
import math

file_gb, block_mb, replication = 10, 128, 3
blocks = math.ceil(file_gb * 1024 / block_mb)
raw_storage_gb = file_gb * replication
print(f"{file_gb} GB file -> {blocks} blocks of {block_mb} MB, stored {replication}x = {raw_storage_gb} GB on disk")

# the small-files problem: NameNode memory, roughly 150 bytes per file or block object
small_files = 10_000_000
print(f"{small_files:,} small files need ~{small_files * 2 * 150 / 1e9:.1f} GB of NameNode heap "
      f"(one file object + one block object each)")
Output
10 GB file -> 80 blocks of 128 MB, stored 3x = 30 GB on disk
10,000,000 small files need ~3.0 GB of NameNode heap (one file object + one block object each)
ConceptWhy it matters today
Data localityMove computation to the data: the idea behind Spark executors reading local blocks
Write once, read manyFiles are appended or replaced, not edited in place: like Parquet files in a lake
Small-files problemMillions of tiny files overload metadata; compaction is still a daily job in lakehouses
SuccessorsCloud object storage (S3, ADLS, GCS) replaced HDFS for most new platforms: cheaper, elastic, no cluster to run

Deep dive: the Hadoop & HDFS guide covers this in more depth.

Say this in the interview

"HDFS splits files into 128 MB blocks replicated three times across racks; the NameNode holds metadata and DataNodes hold blocks, with heartbeats and automatic re-replication on failure. Its ideas (data locality, immutable files, the small-files problem) still shape lakehouses, but object storage like S3 has replaced it for most new platforms."

9. Apache Spark

Spark is a distributed processing engine. A driver builds a plan; executors on many machines process partitions of the data in parallel. Transformations are lazy: nothing runs until an action (count, write, show) triggers a job.

ConceptMeaning
Transformation vs actionselect/filter/join build a plan; count/write/collect execute it
Narrow vs wideNarrow (filter, select) stays in a partition; wide (groupBy, join) needs a shuffle across the network
Job → stage → taskStages are split at shuffles; one task per partition
Catalyst and AQEThe optimiser rewrites plans; Adaptive Query Execution adjusts joins and partitions at runtime
Join strategiesBroadcast hash join for a small side; sort-merge join for two large sides
orders = spark.createDataFrame(
    [(1, "C1", "2026-03-01", 120.0), (2, "C2", "2026-03-01", 80.0), (3, "C1", "2026-03-02", 300.0),
     (4, "C3", "2026-03-02", 45.0), (5, "C2", "2026-03-03", 150.0)],
    "order_id INT, customer_id STRING, order_date STRING, amount DOUBLE")
customers = spark.createDataFrame([("C1", "Pune"), ("C2", "Delhi"), ("C3", "Pune")], "customer_id STRING, city STRING")

result = (orders.filter(F.col("amount") >= 50)  # narrow
                .join(F.broadcast(customers), "customer_id")  # small side broadcast: no shuffle of orders
                .groupBy("city")  # wide: shuffle by city
                .agg(F.count("*").alias("orders"), F.sum("amount").alias("revenue"))
                .orderBy(F.desc("revenue")))
result.show()

plan = result._jdf.queryExecution().executedPlan().toString()
print("broadcast join used:", "BroadcastHashJoin" in plan, "| shuffle for groupBy:", "Exchange hashpartitioning" in plan)

w = Window.partitionBy("customer_id").orderBy("order_date")
orders.withColumn("running_total", F.sum("amount").over(w)).orderBy("customer_id", "order_date").show()
Output
+-----+------+-------+
| city|orders|revenue|
+-----+------+-------+
| Pune|     2|  420.0|
|Delhi|     2|  230.0|
+-----+------+-------+

broadcast join used: True | shuffle for groupBy: True
+--------+-----------+----------+------+-------------+
|order_id|customer_id|order_date|amount|running_total|
+--------+-----------+----------+------+-------------+
|       1|         C1|2026-03-01| 120.0|        120.0|
|       3|         C1|2026-03-02| 300.0|        420.0|
|       2|         C2|2026-03-01|  80.0|         80.0|
|       5|         C2|2026-03-03| 150.0|        230.0|
|       4|         C3|2026-03-02|  45.0|         45.0|
+--------+-----------+----------+------+-------------+

Performance checklist

ProblemFix
Too many small files / tiny partitionsCoalesce on write, compaction, AQE coalescing
Skewed key makes one task slowAQE skew join, salting, isolate hot keys
Shuffle of a big table to join a small oneBroadcast the small side
Spill to diskMore partitions, more memory per executor, avoid wide rows
Re-reading the same dataCache only when reused several times; unpersist after
Python UDFs slowBuilt-in functions first, then pandas UDFs (vectorised)

Deep dive: the Spark & Databricks guide covers this in more depth.

Say this in the interview

"Spark runs a lazy plan across executors, one task per partition. Narrow transformations stay local; wide ones shuffle data, which is where cost lives. I let Catalyst and AQE optimise, broadcast small tables, fix skew, size partitions, avoid Python UDFs, and read the physical plan to confirm the join strategy."

10. Apache Kafka

Kafka is a distributed, durable, append-only log. Producers write records to topics; each topic is split into partitions replicated across brokers. Consumers read at their own pace and track their position with offsets. Because data stays for the retention period, many independent consumers can read, and re-read, the same events.

ConceptMeaning
PartitionOrdered log; the unit of parallelism. Order is guaranteed only within a partition
KeyRecords with the same key go to the same partition, so per-key order is kept
ReplicationEach partition has a leader and followers; acks=all waits for in-sync replicas
Consumer groupConsumers sharing work: each partition is read by one consumer in the group
OffsetPosition in a partition; committed after processing
Retention / compactionKeep by time or size, or keep the latest record per key

How keys, partitions and consumer groups work

import zlib
from collections import defaultdict

PARTITIONS = 4
def partition_for(key):  # Kafka hashes the key bytes (murmur2); crc32 stands in here
    return zlib.crc32(key.encode()) % PARTITIONS

events = [("rider_7", "requested"), ("rider_3", "requested"), ("rider_7", "accepted"),
          ("rider_9", "requested"), ("rider_7", "completed"), ("rider_3", "cancelled")]
log = defaultdict(list)
for key, value in events:
    p = partition_for(key)
    log[p].append((len(log[p]), key, value))  # (offset, key, value)

for p in sorted(log):
    print(f"partition {p}: {log[p]}")

consumers = ["consumer-A", "consumer-B"]  # one consumer group
assignment = {c: [p for p in range(PARTITIONS) if p % len(consumers) == i] for i, c in enumerate(consumers)}
print("group assignment:", assignment)
print("rider_7 events stay in order:", [v for p in log for _, k, v in log[p] if k == "rider_7"])
Output
partition 0: [(0, 'rider_7', 'requested'), (1, 'rider_7', 'accepted'), (2, 'rider_7', 'completed')]
partition 1: [(0, 'rider_3', 'requested'), (1, 'rider_3', 'cancelled')]
partition 3: [(0, 'rider_9', 'requested')]
group assignment: {'consumer-A': [0, 2], 'consumer-B': [1, 3]}
rider_7 events stay in order: ['requested', 'accepted', 'completed']
from confluent_kafka import Producer

producer = Producer({"bootstrap.servers": "broker:9092", "acks": "all",
                     "enable.idempotence": True})  # no duplicates on producer retries
producer.produce("trips", key="rider_7", value='{"status": "requested"}')
producer.flush()

Kafka producer: follows the official syntax but was not executed here, because it needs a live cloud account or service.

A consumer group cannot usefully have more consumers than the topic has partitions; extra consumers sit idle. Choose partition counts for peak throughput and future consumer parallelism.

Deep dive: the Kafka & Kinesis guide covers this in more depth.

Say this in the interview

"Kafka is a replicated, partitioned commit log. Keys decide the partition, so per-key order holds; consumer groups split partitions among consumers for parallelism; offsets let consumers resume and replay. With acks=all, idempotent producers and transactional or idempotent sinks, pipelines get effectively exactly-once results."