Data Engineering
Pipelines, orchestration, Spark, SQL, and the data platforms that carry production workloads.
2026
Data Engineering Design Patterns: Partition Overwrite
The fifth post in the data engineering design patterns series loads trades into a table partitioned by trade date, where some trades are booked a day or two late. Overwriting the whole table, overwriting the partitions the batch has rows for, replacing only the run's own day, rebuilding partitions as of the run's end, and leaving the overwrite mode to a session setting, each run on Postgres and on Spark with Delta Lake in the companion code.
19 min read
Data Engineering Design Patterns: Upserts with MERGE
The fourth post in the data engineering design patterns series loads card transactions that settle a day or two after they are authorised, so a row has to be replaced by its key wherever it was first loaded. Part 3's day-replacing load, separate update and insert steps, MERGE handed a batch with two events for one key, Spark's dropDuplicates, a MERGE with no guard, and a guard on the timestamp instead of the sequence, each run on Postgres and on Spark with Delta Lake in the companion code.
21 min read
Data Engineering Design Patterns: Initial Load versus Daily Load
The third post in the data engineering design patterns series loads a month of history before a daily pipeline takes over. A one-off script that drifts from the pipeline in four ways, the pipeline run once per day and once with a month-wide interval, a wide run that deletes the history when one day is rerun, and a run handed a day that has not ended, each run on Postgres and on Spark with Delta Lake in the companion code.
21 min read
Data Engineering Design Patterns: Incremental Loads and Watermarks
The second post in the data engineering design patterns series loads only the new rows from a source table, three hourly runs in a row. A watermark moved before the write commits, a write committed before the watermark, both in one transaction, a row that commits after a later one has been read, and the scheduler's data interval as the alternative, each run on Postgres and on Spark with Delta Lake in the companion code.
15 min read
Data Engineering Design Patterns: Idempotent Loads
The first post in the data engineering design patterns series runs the same daily load twice and asks whether the table changed. A plain append, delete-then-insert keyed on the business date and on the batch date, a crash between the delete and the insert, and the Delta Lake form of the same pattern, each run on Postgres and on Spark with Delta Lake in the companion code.
13 min read
AWS security for data engineers: seventeen recipes, worked through
Most data engineers meet AWS security as a wall of AccessDenied errors and a bucket someone made public. This post is the walkthrough I wish I had been given early: seventeen short recipes in the order I would apply them to a new account. Account-wide guardrails first (public access block, CloudTrail, default encryption), then identity (roles instead of keys, MFA, stale-key hunting), then permissions you generate and simulate instead of guess, permissions boundaries and SCPs so a team can self-serve safely, Session Manager and Secrets Manager for the machines, and finally the bucket policies, cross-account roles, and CloudFront setup that keep data buckets private. Every step is an AWS CLI command you can run in a sandbox account and clean up afterwards.
37 min read
How to read the Spark UI
The Spark UI is the most underused tool in Spark. Most engineers learn to write DataFrame code long before they learn to read what Spark did with it. This is the walkthrough I give people joining my team: the five screens that matter — Jobs, the DAG, SQL, Stages, Storage — what each one is telling you, and the order I check them in when a job misbehaves. Every screenshot comes from a small retail join you can reproduce on a laptop.
15 min read
How granular should a pipeline task be?
A pipeline with one 300-line task is undebuggable; a pipeline with a task per pandas call is unreadable. The rule I use to cut between them: put a task boundary where you would stop and inspect the data, or where you would want a restart to begin — and nowhere else.
11 min read
TRY…CATCH, ROLLBACK, THROW: the case for explicit error handling in T-SQL
Plenty of warehouse procs rely on SET XACT_ABORT ON to clean up after failures — a one-liner most of the team has cargo-culted without knowing what it does. My position: make the error path explicit. TRY…CATCH, a visible ROLLBACK, and a THROW form a contract any reviewer can read — with XACT_ABORT kept underneath as the safety net it actually is.
8 min read
Metadata-driven ETL: how far should configuration go?
Spec-driven pipelines are the right instinct — until the spec language grows conditionals and becomes a worse programming language. Where the line sits between metadata and code, why load patterns should be a closed set, and the smells that say your platform has crossed it.
7 min read
One DAG, every environment: the environment-aware DAG factory
How a small decorator around Airflow's @dag plus a tiered config object lets the same DAG definition run in dev, sit, uat, and prod — with no per-environment copies, no config drift, and promotion as a one-line gate.
5 min read
The scheduler inside the scheduler: an Airflow anti-pattern and its paved-road fix
Why the controller-DAG-plus-generic-executor pattern hurts more than it helps, and how spec-driven DAG factories keep jobs as config without giving up per-job scheduling, backfills, and observability.
7 min read
Migrating from enterprise schedulers to Apache Airflow: patterns that hold up
A pattern guide for moving batch workloads off Control-M or Autosys onto Airflow: inventory first, standardize the DAG template, and reconcile before every cutover.
5 min read