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.
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.
| Job | Tools on this page | Alternatives |
|---|---|---|
| Move data in (EL) | Fivetran | Airbyte, Stitch, ADF, AWS DMS, Debezium |
| Transform | dbt, Spark | SQL, Lakeflow Declarative Pipelines, Dataflow |
| Orchestrate | Airflow | Dagster, Prefect, Lakeflow Jobs, Step Functions |
| Store and query | Snowflake, BigQuery, Databricks, HDFS | Redshift, Synapse, Fabric, ClickHouse |
| Stream | Kafka | Kinesis, 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).
| Concept | What it is |
|---|---|
| Model | A 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 |
| Materialization | view, table, incremental, ephemeral, materialized view |
| Tests | unique, not_null, accepted_values, relationships, plus custom SQL tests |
| Snapshots | SCD Type 2 history of a source table |
| Contracts | Enforced column names and types for public models |
| Docs and lineage | Generated 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.
"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.
| Concept | Meaning |
|---|---|
| DAG | A workflow: tasks plus dependencies, with a schedule |
| Task / operator | One unit of work: run SQL, a Spark job, a Python function, a dbt command |
| Data interval | The period a run is responsible for (e.g. yesterday), exposed as ds |
| Sensor | Waits for a condition: a file, a partition, another DAG |
| XCom | Small values passed between tasks (not datasets) |
| Assets (datasets) | Schedule a DAG when an upstream asset is updated |
| Executor | Where 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 += 1wave 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.
"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.
| Feature | How it works |
|---|---|
| Incremental sync | Log-based CDC for databases, cursor fields or webhooks for APIs |
| Schema drift | New columns and tables added automatically (configurable) |
| History mode | Keeps SCD Type 2-style history of source rows |
| Pricing | Based on monthly active rows (rows inserted, updated or deleted) |
| Transformations | Integrates with dbt to transform after loading |
| Choose | When |
|---|---|
| Fivetran | Many 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 |
"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
| Feature | Why it matters |
|---|---|
| Virtual warehouses | Separate compute for ETL, BI and data science; scale up for big queries, out (multi-cluster) for concurrency |
| Micro-partitions + pruning | Min/max metadata per micro-partition skips data; clustering keys improve it |
| Time Travel and Fail-safe | Query or restore past data (up to 90 days on Enterprise) |
| Zero-copy cloning | Clone a database instantly for testing; storage shared until changed |
| Snowpipe / Streams and Tasks / Dynamic Tables | Continuous loading and incremental transformation |
| Secure data sharing | Share live tables with other accounts without copying |
| Iceberg tables | Store 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.
"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).
| Feature | Detail |
|---|---|
| Pricing | On-demand per TB scanned, or capacity (slot reservations); storage billed separately |
| Partitioning | By ingestion time, a DATE/TIMESTAMP column or an integer range; prunes scanned data |
| Clustering | Sorts data within partitions by up to four columns; prunes further |
| Nested and repeated fields | STRUCT and ARRAY columns: denormalise without joins |
| Streaming | Storage Write API for real-time ingestion |
| BigQuery ML | Train 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.
"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.
| Component | Role |
|---|---|
| Delta Lake | ACID tables on Parquet with a transaction log: MERGE, time travel, schema enforcement |
| Unity Catalog | One governance layer: catalogs, permissions, lineage, tags, audit |
| Auto Loader | Incremental file ingestion with schema tracking |
| Lakeflow Declarative Pipelines | Declarative batch and streaming pipelines with data quality expectations |
| Lakeflow Jobs | Orchestration of notebooks, pipelines and SQL |
| Databricks SQL | SQL warehouses (including serverless) for BI |
| MLflow / Mosaic AI | Experiment 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()+--------+-------+------+ |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.
"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)")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)
| Concept | Why it matters today |
|---|---|
| Data locality | Move computation to the data: the idea behind Spark executors reading local blocks |
| Write once, read many | Files are appended or replaced, not edited in place: like Parquet files in a lake |
| Small-files problem | Millions of tiny files overload metadata; compaction is still a daily job in lakehouses |
| Successors | Cloud 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.
"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.
| Concept | Meaning |
|---|---|
| Transformation vs action | select/filter/join build a plan; count/write/collect execute it |
| Narrow vs wide | Narrow (filter, select) stays in a partition; wide (groupBy, join) needs a shuffle across the network |
| Job → stage → task | Stages are split at shuffles; one task per partition |
| Catalyst and AQE | The optimiser rewrites plans; Adaptive Query Execution adjusts joins and partitions at runtime |
| Join strategies | Broadcast 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()+-----+------+-------+ | 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
| Problem | Fix |
|---|---|
| Too many small files / tiny partitions | Coalesce on write, compaction, AQE coalescing |
| Skewed key makes one task slow | AQE skew join, salting, isolate hot keys |
| Shuffle of a big table to join a small one | Broadcast the small side |
| Spill to disk | More partitions, more memory per executor, avoid wide rows |
| Re-reading the same data | Cache only when reused several times; unpersist after |
| Python UDFs slow | Built-in functions first, then pandas UDFs (vectorised) |
Deep dive: the Spark & Databricks guide covers this in more depth.
"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.
| Concept | Meaning |
|---|---|
| Partition | Ordered log; the unit of parallelism. Order is guaranteed only within a partition |
| Key | Records with the same key go to the same partition, so per-key order is kept |
| Replication | Each partition has a leader and followers; acks=all waits for in-sync replicas |
| Consumer group | Consumers sharing work: each partition is read by one consumer in the group |
| Offset | Position in a partition; committed after processing |
| Retention / compaction | Keep 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"])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.
"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."