Learn Data Engineering

How data gets from an operational system to an analytical consumer while staying complete, correct, fresh, explainable and affordable — and how you find out when it has not. Twenty-eight modules, from the shape of the problem to explaining where a number came from.

SourceIngestionRawTransformationValidationStorage ModelServingConsumerObservability

Data Engineering Fundamentals

8 lessons

What this discipline is once the tools are removed: the journey from an application write to a number on a dashboard, the thirteen things that go wrong along it, and why "the pipeline succeeded" is not evidence that the data is right.

What Data Engineering Actually Is
▶ lab

Not the tools. The discipline of moving data between systems so that what arrives is complete, correct, explainable and affordable.

Q · A dashboard says revenue was €1,245,892 yesterday. What had to be true for that number to be trustworthy?
The Fundamental Data Journey
▶ lab

Application to PostgreSQL to extract to lake to transformation to warehouse to mart to dashboard — and what each arrow is actually promising.

Q · Why does a number have to pass through six systems to reach a dashboard, and what does each of those hops buy?
What Goes Wrong Between Source and Dashboard
▶ lab

Thirteen failure classes, each with its own mechanism, its own detector, and a long list of checks that will never find it.

Q · The job succeeded, the table has rows, and the number is wrong — which of the thirteen things that go wrong is this one?
Data Engineering vs Its Neighbours
▶ lab

Databases own storage, distributed systems own guarantees, backends own the transactional service, analytics and ML are consumers. We own movement, transformation, modelling, validation and serving.

Q · A team argues about who owns a broken number — the backend that produced the event, the database it was written to, or the model that aggregated it. Where does each boundary actually fall?
The Data Loop
▶ lab

Source, ingestion, raw, transformation, validation, storage model, serving, consumer, feedback — nine stages that are a design order forwards and a diagnostic order backwards.

Q · Given any data problem, in what order should I reason about it — and which direction do I walk during an incident?
Source of Truth
▶ lab

One authoritative system per business concept, everything else explicitly a copy — and the discipline that follows once you have said which is which.

Q · `customer_country` exists in the CRM, on the orders table and in the customer dimension, and all three disagree. Which one is right, and how would anybody know?
Who Actually Consumes This Data
▶ lab

Analysts, finance, product analytics, ML, agents and operational read-back each need a different freshness, tolerate a different amount of revision, and fail in a different way. Design from them inward.

Q · Before designing a dataset, what should I know about the people who will read it — and which of their needs will silently invalidate my design if I guess?
Trusting Data
▶ lab

Trust is not a feeling about a dashboard — it is a set of questions a consumer can answer without asking you. It is built slowly, lost in one incident, and rebuilt at a much higher price.

Q · What has to be true about a number before someone should act on it, and how would they check without asking the person who built it?

OLTP vs OLAP

7 lessons

Two workloads with opposite shapes — many small transactions against current state, versus large scans across history. The distinction that explains why analytics moved off the production database in the first place.

OLTP Workloads

Many small transactions against current state: point lookups by key, a few rows written, low latency, high concurrency. The shape that explains every design choice an operational database makes.

Q · What does the work an operational database actually does look like, one statement at a time?
OLAP Workloads

Few queries, each reading a large range of history and collapsing it into a handful of numbers. Judged on throughput rather than latency, bound by bytes moved rather than by seeks, and unhelped by almost every index you could add.

Q · What does an analytical query actually ask for, and why does no index make it fast?
OLTP vs OLAP

The two workloads compared on every axis that actually differs — plus an honest account of where the line has blurred, where it has not, and why the distinction still decides your architecture.

Q · Which properties genuinely differ between the two workloads, and which supposed differences are folklore?
Workload Isolation

What an analytical query actually takes from the operational system it runs on — and the specific, honest cases where running it there is still the right call.

Q · What does an analytical query take from the operational system it runs on, and when is that price worth paying?
The OLTP to OLAP Journey

Production database, extraction, transport, raw landing, transformation, analytical storage, BI query — what each hop buys, what it actually promises, and where the shape of the data changes underneath you.

Q · By what route does a committed operational row become a number in an analytical query, and what does each hop along that route promise?
Row vs Column Storage

The same four columns of the same table, written to disk two ways — and exactly which bytes each query is then obliged to move as a result.

Q · If two systems hold identical data, why does the physical arrangement decide which queries are possible?
Columnar Execution

What an engine actually does with `SELECT avg(spend) FROM users WHERE country = 'DE'` once the data is stored by column: chunks opened, blocks skipped, batches decoded, a predicate evaluated into a mask, and one running total.

Q · Once the data is stored by column, what does the engine do with it that a row-at-a-time engine structurally cannot?

File Formats & Compression

9 lessons

Parquet, Avro, ORC and the text formats they replaced. Row groups, column chunks, statistics, encodings — what a format actually stores, and what that lets a reader skip.

Why Analytical Data Compresses

Columns of one type with repeating values compress in ways rows of mixed types cannot — and the chain from fewer bytes to a faster query has three places it can break.

Q · Why does the same dataset shrink dramatically when stored column by column, and why does that not automatically make queries faster?
Dictionary, Run-Length, Delta and Bit Packing

Four type-aware encodings, what redundancy each one exploits, and the column property — cardinality, sortedness, range — that decides whether it does anything at all.

Q · Which property of a column decides whether an encoding shrinks it, and how would I know which encoding my writer actually chose?
Parquet

A self-describing, columnar, splittable file whose footer tells a reader what it can skip — which is a different claim from "it is smaller".

Q · What does a Parquet file physically contain that a compressed CSV does not, and which of those things does a query actually use?
Parquet Internals

Row groups, column chunks, pages and the footer — where statistics come from, why they are only useful when the data is sorted, and how nesting is stored without abandoning columns.

Q · A query filters on `event_date` and my engine still reads every row group. What in the file decides whether a row group can be skipped?
The Parquet Read Path

Follow `SELECT country, revenue FROM events WHERE date = '2026-08-25'` from a directory listing to decoded values, and count what got skipped at each of the four gates.

Q · For one concrete query against a partitioned Parquet dataset, exactly which bytes are read and which are never touched?
Avro

Row-oriented binary records with the schema travelling alongside the data — built for exchange and evolution rather than for scanning one column across a billion rows.

Q · When is storing whole records together the right answer, and what does carrying the schema with the data actually buy?
ORC

A sibling columnar design with the same goals and different specifics: stripes instead of row groups, row-index strides for finer skipping, and row-level ACID in the ecosystem it grew up in.

Q · ORC and Parquet solve the same problem — so what is actually different, and when does the difference decide anything?
Parquet vs Avro

Not a rivalry. One is built for reading a few columns across many rows, the other for handling whole records one at a time — and most pipelines use both, in that order.

Q · For this specific hop, does the consumer read a few columns across many records, or every field of a few records at a time?
CSV, JSON and Their Limits

No types, no schema, no statistics, ambiguous quoting and — for CSV — a splittability problem that has no clean fix. And still the right answer for interchange, small data and human inspection.

Q · What exactly does a text format fail to store, and when is that failure irrelevant?

Data Ingestion

8 lessons

Getting data out of systems you often do not control. Batch extracts, incremental windows, streaming producers, and the failure recovery that decides whether a missed hour is recoverable or gone.

Data Ingestion

Moving data out of systems you do not control and into storage you do — and the difference between what arrived and what happened.

Q · What has to be true for the records that land in my storage to be exactly the records that occurred in the source — no fewer, and no more?
Ingestion Sources

Databases, APIs, logs, files, event streams, SaaS systems and object storage — seven extraction models, seven failure behaviours, and seven different meanings of "everything since last time".

Q · For this particular source, what can I actually ask it, what will it refuse to tell me, and how would I know if a record never arrived?
Batch Ingestion

Every hour, select what is new, write files, load the warehouse. The simplest thing that works — and the specific ways it stops working.

Q · When is a scheduled extract the right answer, and what exactly does a batch boundary do to the data that sits on either side of it?
Incremental Extraction

Asking a source for "everything since last time" — and the specific, silent, permanent ways `WHERE updated_at > :last_run` gets that wrong.

Q · My extract selects rows changed since the last run and every run succeeds. Which rows is it structurally incapable of returning, and how would I ever find out?
Streaming Ingestion

Event happens, producer publishes, broker durably holds, consumer reads, storage lands it. Continuous rather than windowed — and continuously running.

Q · What does moving ingestion from a schedule to a continuous consumer actually change about what can be lost, duplicated, reordered or delayed?
Batch vs Streaming Ingestion

Not old versus new. Two designs with different freshness shapes, different failure surfaces, different recovery stories and very different operational burdens.

Q · Which of these two should this particular source use, and what is the criterion that decides it rather than the preference that usually does?
Ingestion Failure & Recovery

What to do when an extract fails, a connector stalls or a consumer falls behind — and how to tell, quickly, whether the data is late or gone.

Q · Ingestion has been broken for some hours. Which of the missing data is recoverable, from what, and what will re-running it break that currently works?
The Raw Landing Zone

Land what arrived, exactly as it arrived, including the fields you do not use. Never clean in place. Partition by arrival so a re-run is bounded.

Q · When a transformation turns out to have been wrong for six months, what do I re-run it against — and does that thing still exist unmodified?

ETL & ELT

7 lessons

Where transformation runs and what that decides. Not a fashion — a question about where compute lives, how much raw history you keep, and what you can reprocess after you find a bug.

ETL: Transform Before the Data Lands
▶ lab

Extract, transform, load. The destination only ever sees rows that already conform — a real guarantee for its readers, bought with the original that nobody kept.

Q · If the destination is perfectly capable of storing the raw rows, why would anyone transform the data before it gets there?
ELT: Load First, Transform Where the Data Lives
▶ lab

Extract, load, transform. The destination holds the raw copy and does the work — which turns most transformation bugs into a re-run and hands the destination every obligation the raw data carries.

Q · What does a pipeline gain by loading data it has not yet cleaned, and what does the destination inherit the moment it does?
ETL vs ELT: Choosing by Constraint, Not by Fashion
▶ lab

Two orderings, six criteria. Where compute is available, how large raw is, whether you need history, what security forbids, how complex the logic is, and what the destination can actually do.

Q · For this specific source, feeding this specific destination, which ordering does the constraint actually permit — and which one is a preference dressed as a principle?
Where the Transformation Actually Runs
▶ lab

In the source, in a dedicated cluster, in the warehouse, in the query at read time, or in the BI tool. Each placement moves cost, freshness, testability and governance somewhere different.

Q · A number needs filtering, joining and aggregating before a human sees it — so which machine should do that work, and what does putting it there decide?
Raw, Staging, Curated: Layers by Purpose
▶ lab

Three jobs that need separating — preserve what arrived, make it usable, model it for consumers. The names vary by house; the purposes do not.

Q · Why does the same data get written three times on its way from a connector to a dashboard, and what is each copy actually for?
Medallion: One Naming Convention Among Several
▶ lab

Bronze, silver, gold is a widely used set of names for raw, staging and curated. It is a convention, not a requirement, and it is not an architecture.

Q · What does calling a layer "bronze" tell a consumer that calling it "raw" does not — and what does the medal metaphor quietly imply that is false?
Keeping Raw History: The Recovery Position and the Liability
▶ lab

An immutable copy of what arrived is what makes every downstream mistake fixable. It is also the most sensitive dataset the platform holds. Both are true and neither cancels the other.

Q · What can you still fix a year from now, and what have you promised to be able to delete?

Lakes, Warehouses & Lakehouses

8 lessons

Object storage, analytical warehouses, and the table-metadata layer that gave files transactions. Compared on data types, query patterns, governance, cost, openness and tooling — not on marketing.

The Data Lake
▶ lab

One place to land structured, semi-structured and unstructured data before anyone knows which questions it will answer — and the reason most lakes become swamps.

Q · Where do you put data whose schema you do not control, at a volume a database will not hold, before you know what it will be used for?
The Data Warehouse
▶ lab

An analytical database built for large scans and aggregations over structured, modelled data — and what it gives you that a pile of files cannot.

Q · What does an analytical database do that a query engine over files does not, and what are you paying for it in flexibility?
The Lakehouse
▶ lab

Object storage for the bytes, a table metadata layer for the transactions, and independent query engines on top — a combination rather than a product.

Q · Can files on object storage behave like tables, and what exactly is added to make that true?
Open Table Formats
▶ lab

How Iceberg, Delta and Hudi turn immutable objects into a transactional table: a manifest of which files are the table now, and a commit that is one pointer swap.

Q · How can a set of immutable files on storage with no rename and no multi-object atomicity behave like a table with transactions?
Lake vs Warehouse vs Lakehouse
▶ lab

A comparison across data types, query patterns, governance, cost shape, openness, transactions and tooling — with the vendor framing removed and the overlap admitted.

Q · Given this data, these consumers and this team, which storage posture actually fits — and why is the honest answer so often "more than one"?
Object Storage as Data Infrastructure
▶ lab

Buckets, keys, objects and metadata — and the four properties of that model that decide how every data pipeline above it must be written.

Q · What does it change about a pipeline that its storage has a flat key space, no rename, per-request cost and immutable objects?
Data Marts
▶ lab

A narrow, purpose-built, usually pre-aggregated serving copy that trades flexibility and freshness for query cost and simplicity.

Q · When is it worth materialising a narrower copy of a model, and what does every consumer of that copy lose?
Separating Storage from Compute
▶ lab

Scale each independently, point many engines at one copy, pay for compute only while it runs — and pay a network, a cold start and the loss of locality for it.

Q · What changes when the machine holding the data is not the machine querying it, and what does that separation cost?

Physical Data Layout

9 lessons

Where bytes physically sit decides what a query must read. File size, compaction, partitioning, pruning, cardinality, clustering and bucketing — the highest-leverage and least-visible decisions in analytics.

Physical Data Layout

Two datasets with identical rows and identical schemas can differ by an order of magnitude in what a query must read. The difference is which rows share a file and which files share a directory.

Q · The rows are the same, the schema is the same and the query is the same — so why does one copy of this dataset cost far more to query than the other?
File Size and the Small-Files Problem

The same bytes split into a million objects behave nothing like the same bytes in a hundred. On object storage the cost is per request, so this is a problem about file count, not data volume.

Q · The table holds the same data it held last month and the same total size, but every query against it got slower. What changed?
File Compaction

Rewriting many small files into fewer larger ones. What it buys, what it costs, and what a reader sees if it is halfway through when their query starts.

Q · The table is made of far too many files. Rewriting them into fewer, larger ones fixes the reads — so what does that rewrite cost, and what happens to everyone reading the table while it runs?
Partitioning

Putting a column's value into the directory path so a reader can exclude data without opening it. The cheapest skip available, and the only one that costs nothing to evaluate.

Q · Why does writing `date=2026-08-24` into the directory name make a query cheaper than storing exactly the same date as a column inside the files?
Partition Pruning

The planner eliminating partitions before reading. It is a best-effort behaviour, not a guarantee — and there are four common predicate shapes that silently defeat it while looking completely correct.

Q · The table is partitioned by date, the query filters on date, and it still read the whole table. What stopped the planner from pruning?
Partition Cardinality

A partition key with too many distinct values produces more metadata than data. The target is enough rows per partition to justify a file, and few enough partitions to list.

Q · How many partitions is too many — and how would you know before you have written four years of them?
Clustering and Sort Order

Within a partition, the order rows were written in decides how selective file statistics are. Sorting is what turns a min/max into a skip, and it decays as soon as you stop maintaining it.

Q · Inside a single partition, does the order the rows were written in change anything? The answer is the same rows either way — so why would it?
Bucketing

Hashing a key into a fixed number of files so that rows with the same key always land in the same bucket. One physical technique, and it earns its keep almost exclusively when it lets a join skip the shuffle.

Q · When is it worth deciding, at write time, exactly which file every row will live in — and what does that buy that sorting does not?
The Partitioning Decision

Five questions that decide a partition key: what the filters carry, how many distinct values, how much data per partition, how often data is appended, and whether the distribution is skewed. Answer them from data, not from intuition.

Q · Given this table and the queries that actually run against it, what should the partition key be — and is the honest answer sometimes that there should not be one?

Analytical Data Modeling

12 lessons

Facts, dimensions, grain and history. The model decides which business questions are easy, which are expensive, and which are answerable but silently wrong.

Analytical Data Modeling
▶ lab

Choosing the shape of the tables people query, so that the questions the business asks are easy to write, correct by construction and affordable to run.

Q · What shape should the tables a consumer queries have, so that the questions the business actually asks are easy, correct and cheap to answer?
Operational vs Analytical Models
▶ lab

Normalised, transaction-oriented schemas and fact/dimension, query-oriented schemas solve different problems. Neither is a degraded version of the other.

Q · Why is the schema that is correct for an application the wrong one for analytics, and what exactly changes between them?
Fact Tables
▶ lab

Tables of measurements of a business process, at a declared grain, with keys to context — and the measure types that decide whether SUM() means anything.

Q · What belongs in a fact table, at what grain, and which of its columns are safe to add up?
Grain: What Does One Row Represent?
▶ lab

The single most important question in analytical modelling. Answer it in one sentence per table, or every aggregate downstream is a guess.

Q · What does exactly one row of this table represent, and what happens to every metric if two people answer that differently?
Dimension Tables
▶ lab

The descriptive context you filter and group by — customer, product, date, region — and the reason a calendar deserves a table of its own.

Q · Where should the attributes people filter and group by live, and why not simply on the fact table?
Surrogate Keys
▶ lab

A warehouse-generated key with no business meaning, because with history the natural key stops being unique and because source ids change underneath you.

Q · Why should a fact join to a warehouse-generated key rather than to the identifier the source system already provides?
Star Schema
▶ lab

One fact table in the middle, dimensions one join away on every side. The shape that makes queries short, joins predictable and grain visible.

Q · Why is a central fact table surrounded by single-join dimensions the dominant analytical shape, and when is it the wrong one?
Snowflake Schema
▶ lab

Dimensions normalised into their own hierarchies. Fewer repeated values, one place to correct a taxonomy, more joins in every query — and an honest comparison of when that trade pays.

Q · When is it worth normalising a dimension into a hierarchy instead of flattening it into the dimension table?
Slowly Changing Dimensions
▶ lab

A customer moves from Poland to Germany. Do last quarter's Polish revenue figures change? That question, answered per attribute, is the whole topic.

Q · When a descriptive attribute changes, should history be restated to the new value or preserved as it was?
SCD Type 2 in Practice
▶ lab

valid_from, valid_to, is_current — the columns that preserve history, the join predicate every fact must use, and the interval bugs that produce numbers reconciling against nothing.

Q · How do you store every version of a dimension attribute, and how does a fact pick the one version that was true when it happened?
Snapshot Tables
▶ lab

Capture the state of every entity at the end of every period. `account_balance_daily` answers "what was it on the 14th" with a lookup instead of a fold over all history.

Q · How do you answer "what was the state of everything on a given date" without replaying every change that ever happened?
Event vs Snapshot Modeling
▶ lab

Events record what changed; snapshots record what was true at time T. Different storage curves, different query complexity, and different questions made easy.

Q · Should this be modelled as a stream of changes or as periodic captures of state, and which questions does each choice make hard?

Transformation

8 lessons

Cleaning, casting, joining, aggregating and deduplicating — expressed as a dependency graph of tested, documented models rather than a pile of scheduled scripts.

Data Transformation
▶ lab

Clean, cast, join, aggregate, deduplicate, enrich, filter, normalize, denormalize — nine operations, each with a way of being wrong that does not raise an error.

Q · What are the operations that turn raw arrival into a queryable table, and which of them can be wrong while every job reports success?
SQL Transformations
▶ lab

The five-line aggregate everyone writes, and the thirty-line one that is still correct after duplicates, refunds, currency and late data exist.

Q · Why does the obviously correct `SUM(revenue) GROUP BY customer_id` stop being correct, and what does the correct version actually have to account for?
dbt Concepts
▶ lab

Transformations as version-controlled, tested, documented models whose dependencies are inferred rather than declared — and materialisation as a choice you make on purpose.

Q · What does a transformation framework actually give you that a folder of scheduled SQL scripts does not?
The Transformation DAG
▶ lab

raw_orders to stg_orders to int_orders_enriched to fct_orders to customer_metrics — five nodes, four edges, and everything you can ask of a graph you did not have to draw.

Q · What does turning a pile of transformations into an explicit dependency graph let you ask that you could not ask before?
DAGs in Data Pipelines
▶ lab

Node, edge, no cycles — the whole structure. Why every question a data platform asks about itself turns out to be a standard graph traversal, and why a cycle is almost always a modelling error.

Q · Why is the dependency graph of a data platform required to be acyclic, and what does a cycle actually tell you when you find one?
Topological Execution
▶ lab

If A feeds C and B feeds C, then A and B can run together and C must wait. What that ordering buys — parallelism, correctness of order, selective rebuild — and the one thing it emphatically does not buy.

Q · What exactly does executing a graph in topological order guarantee, and what does a completed topological run still fail to tell you?
Model Layering
▶ lab

Staging renames and types one source. Intermediate joins and reshapes. Marts face the business. The rule that makes it work is that consumers depend only on marts.

Q · Why split a transformation into staging, intermediate and mart layers when one query would produce the same table?
The Metrics Layer
▶ lab

Business logic copied into twenty dashboards produces twenty definitions of revenue, all defensible. A metric defined once, with an owner, is the only fix — and it does not fix everything.

Q · Two teams present revenue for the same quarter and the numbers differ. Both queries are correct. What is actually broken?

Orchestration

8 lessons

Coordinating work by dependency, state and time. Why a scheduler is not an orchestrator, what a failed task in the middle of a DAG means, and why idempotency is the property that makes re-running safe.

Orchestration

Coordinating work by dependency, state and time — deciding not only when a task may start but whether it should, and what its result means.

Q · What actually decides that a task is allowed to run right now, and what does the orchestrator know that a clock does not?
Scheduler vs Orchestrator

"Run at 02:00" versus "run B after A succeeds, retry C, skip D if the source is empty" — a difference in what the system remembers, not in how it is configured.

Q · When does a schedule stop being sufficient, and what exactly does an orchestrator add beyond firing a command at a time?
Airflow Concepts

A DAG of tasks, a scheduler, a metadata database and workers — and the logical data interval, which is the most misunderstood idea in orchestration.

Q · When a run is labelled 2026-03-11 but executes on the 12th, which day's data is it responsible for — and what happens when you re-run it in June?
Task Dependencies

The edges are the program. What "B runs after A" means when A is skipped, when A is upstream of forty tasks, and when B secretly reads a table nobody declared.

Q · What does "after" actually mean in a task graph — after success, after completion, after data arrival — and which edges are missing from your graph right now?
When a Task Fails Mid-DAG

A succeeded, B succeeded, C failed. Re-run everything, only C, or C and everything downstream? The answer is decided entirely by idempotency.

Q · A task fails in the middle of a graph that has already written data. What is safe to re-run, and how do you know the parts that succeeded are still correct?
Idempotent Data Pipelines

Re-running the same logical input must not corrupt or duplicate the result. A pipeline that cannot be re-run is a pipeline whose every bug is permanent.

Q · If I run this task twice for the same interval, is the result identical to running it once — and if not, what exactly do I do the next time I find a bug in it?
Incremental Processing

Process what is new instead of recomputing ten years — and inherit, in exchange, every problem of state: watermarks, late data and two eras in one table.

Q · Which records does this run actually need to process, and what happens to the ones that should have been in the last run but were not there yet?
The High-Water Mark

"Processed through offset X" — the one piece of state that decides what a restart re-reads, and why a log position is a promise and a timestamp is a guess.

Q · After a crash, where does this pipeline resume — and is the thing it resumes from an exact position or an approximation of one?

Change Data Capture

7 lessons

Reading a database's own change log instead of asking it questions. What CDC gives you that polling cannot, what it costs the source, and every way it silently loses or reorders changes.

Change Data Capture
▶ lab

Reading committed changes out of the database's own transaction log, so downstream systems learn what happened instead of repeatedly asking what is true now.

Q · A row in `orders` changed at 03:14. How does a downstream system find out about that change — without interrogating the database on a loop, and without missing the change entirely?
CDC vs Polling
▶ lab

One asks the database what is true now, on a loop. The other observes what the database committed. The difference is not speed — it is which changes are structurally invisible.

Q · A nightly job selects every row where `updated_at` is newer than the last run. Which real changes does that query structurally fail to see, and when is it still the right answer?
What a CDC Event Contains
▶ lab

An operation, a before image, an after image and source metadata. Which of those you actually receive is decided by the source's configuration, not by CDC.

Q · A CDC record arrives describing an update to one order. What is inside it, what is deliberately absent, and which parts can you rely on being there?
CDC Ordering and Transaction Boundaries
▶ lab

The source log has a total order and a transaction boundary. Publishing splits both, and every consumer that joins two tables inherits the consequences.

Q · One transaction updated `orders` and `order_items` together. Downstream, why can a consumer see one of them and not the other — and for how long?
Snapshot and Stream: the Bootstrap Problem
▶ lab

CDC starts from now. Everything that existed before now has to be read separately and stitched to the stream without a gap and without a duplicate that a later ordering guard cannot resolve.

Q · The connector starts today against a table with four years of rows in it. Where do the four years come from, and how do you join them to the live stream without losing a change or double-counting one?
CDC Failure Modes and the Retention Deadline
▶ lab

A consumer falls behind. Whether that is an inconvenience or an unrecoverable data loss is decided entirely by whether the connector's position is still inside the source's retained log.

Q · The connector has been down since Friday and it is now Monday. Can you replay what you missed — and how would you find out before you promise someone that you can?
CDC and Schema Drift
▶ lab

A migration runs on the source at 02:00. Some connectors emit a schema-change event, some silently reshape the payload, some stop. None of them ask you first.

Q · The application team renamed a column last night. What did the CDC pipeline do about it — and how long before anyone downstream found out?

Event Logs & Brokers

8 lessons

The durable, partitioned, replayable append-only log as data infrastructure. Topics, partitions, keys, consumer groups, offsets and retention — and why replay is the feature that matters most here.

The Event Log

An append-only, immutable, ordered sequence of facts that each reader moves through at its own pace — the primitive underneath brokers, replication, CDC and stream processing.

Q · What can an append-only log of events answer that a table of current state cannot?
Message Brokers: Log-Shaped and Queue-Shaped

Two different products wearing one word. A queue distributes work and forgets; a log stores records and lets anyone re-read them. Neither is the upgrade of the other.

Q · Does this data need a durable replayable log, or a queue that hands each message to exactly one worker and deletes it?
Kafka as a Log, Not a Queue

A partitioned, durable, append-only log with independent consumer groups and time-based retention. Records survive being read, which is the property everything else in a data platform is built on.

Q · Why does calling Kafka a message queue lead teams to build the wrong thing?
Topics and Partitions

A topic is not one log — it is several. Ordering holds inside a partition and nowhere else, and that single sentence explains most of the surprises in a streaming platform.

Q · If a topic is ordered, why did the payment event arrive before the order event that caused it?
Event Keys and Partition Assignment

The key hashes to a partition, and the partition is the scope of ordering. Change the partition count and the hash re-maps, so a key's future loses order against its own past.

Q · Which records need to stay in order relative to each other, and what key makes that true?
Consumer Groups and the Parallelism Ceiling
▶ lab

A group divides a topic's partitions among its instances, one partition to at most one instance. Partition count is therefore the hard ceiling on parallelism, and instances beyond it do nothing at all.

Q · Consumer lag is growing and we have doubled the number of instances. Why has nothing changed?
Retention and Replay

Retention is not a storage setting. It is the maximum age of a bug you can fix by replaying instead of reconstructing — a recovery-window decision that happens to be paid for in disk.

Q · A transformation bug has been producing wrong numbers for three weeks. Can we fix it by reprocessing, or do we have to reconstruct?
Offsets and Commits

Commit before processing and you get at-most-once. Commit after and you get at-least-once. There is no third option unless the commit and the output write share a transaction.

Q · A consumer crashes between reading a record and writing its result. Was that record lost, or will it be processed twice?

Stream Processing

15 lessons

Continuous computation over unbounded data. Event time versus processing time, windows, watermarks, state, joins, and what "exactly-once" can and cannot mean.

Stream Processing

Computation over an input that has no end, where every result is provisional, time becomes a data field, and the job is a long-lived process holding state rather than a script that finishes.

Q · What actually changes about a computation when its input never ends?
Stateless Stream Processing

Filter, map, transform: operators whose output for a record depends only on that record. The cheapest, most restartable, most rescalable thing a stream can do — and a much narrower category than it first appears.

Q · Which streaming transformations can be computed from a single record, and why does that make them so much cheaper to operate?
Stateful Stream Processing

Counting, joining, windowing and deduplicating all require remembering something between records — which turns a job into a database you have to operate.

Q · Which streaming operations cannot be computed from one record alone, and what does the memory they need cost you operationally?
Streaming State

Where the state physically lives, what makes it grow, how it is snapshotted and restored — and why state size, not throughput, is the number that decides whether a streaming job can be operated.

Q · How large will this job's state get, where does it live, and how long does it take to restore after a failure?
Event Time

The time the thing actually happened, carried in the record itself — the only clock that makes a result reproducible when you process the same data again next year.

Q · If I reprocess this stream in six months, will I get the same answer — and which timestamp decides that?
Processing Time

The wall clock of the machine doing the work: always available, always monotonic, never late — and the reason a replay produces a different answer than the original run.

Q · What questions are genuinely about my system rather than about the world, and therefore belong on the processor's own clock?
Ingestion Time

The moment a record entered the processing system, stamped by one clock the platform controls — the timestamp that makes lag measurable and replay stable without pretending to know when anything happened.

Q · When did this record become my platform's responsibility, and what can I hold myself accountable for from that moment on?
Late Events

An event happened at 10:00 and arrived at 10:07. The 10:00–10:05 window was already emitted. What happens next is a policy decision, and most platforms have made it by accident.

Q · An event arrives after the window it belongs to has already been emitted — is it counted, dropped, or does the previous answer change?
Windows
▶ lab

A window is a rule that turns an infinite stream into a set of finite groups you are allowed to aggregate — and choosing the rule decides your state size, your latency and what questions you can answer.

Q · How do I compute an aggregate over an input that never ends, and what does the boundary I choose commit me to?
Tumbling Windows

Fixed size, contiguous, non-overlapping: every event lands in exactly one. The cheapest window and the only family whose results you are allowed to add together.

Q · When is a fixed, non-overlapping bucket the right boundary — and what exactly does "exactly one window per event" buy me?
Sliding Windows

Overlapping windows of fixed size, advancing by a smaller step. Every event lands in size ÷ slide of them, which is exactly the factor by which state, output and the risk of double counting all multiply.

Q · When is a rolling, overlapping view worth multiplying my state and output volume by the overlap factor?
Session Windows

Windows whose boundaries the data draws: a session runs until a key goes quiet for longer than a gap. Per-key, data-dependent, mergeable — and the only window family with no upper bound on its own size.

Q · How do I group events into bursts of activity when the boundaries are defined by silence rather than by the clock?
Watermarks
▶ lab

An estimate of how far event time has progressed, derived from the data itself. It decides when a window may be emitted and what counts as late — and it is a claim, not a measurement.

Q · How does a system that can never know whether more data is coming decide that a period is complete enough to publish?
Stream Joins
▶ lab

Joining two unbounded inputs means holding both sides in state until a time bound says you may stop holding them. Without that bound it is not a join — it is a memory leak with a schema.

Q · An orders stream and a payments stream arrive independently. What has to be true before they can be joined, and what are you agreeing to throw away when you set the bound?
Exactly-Once: Input Consumption, State Update, Output Write
▶ lab

There is no single exactly-once guarantee — there are three separate questions, one about input consumption, one about state update and one about output write, and each is bought by a different, nameable assumption.

Q · A streaming platform advertises that every event is processed once and only once. Which of the three things that could mean is being promised, and what has to be true for it to hold?

Distributed Data Processing

13 lessons

Spark and its relatives from the inside: partitions, stages, tasks and the shuffle. Skew, stragglers and salting — why one task in a thousand decides your job's runtime.

Distributed Data Processing

Splitting one computation across many machines, and the three things that buys you — memory, disk bandwidth and cores — against the one thing it costs: a network in the middle of your query.

Q · At what point does a computation stop fitting on one machine, and what does moving it to a cluster actually buy?
The Spark Execution Model

A driver that plans and schedules, executors that hold data and run tasks, and a cluster manager that hands out machines. Almost every confusing Spark failure is explained by knowing which of the three it happened on.

Q · When a Spark job runs, what is running where — and which machine is the one that just ran out of memory?
Partitions: the Unit of Parallelism

A partition is the slice of rows one task processes alone. Too few and the cluster idles; too many and the scheduler dominates. And it is not the same thing as the partition in your storage path.

Q · How many pieces should this data be cut into, and what decides the number — the data, the cluster, or the query?
Stages and Tasks

A stage is everything that can be done without moving data between machines. The boundary between two stages is always a shuffle, and it is always a barrier.

Q · Why does my job have five stages rather than one, and what decided where the cuts are?
The Shuffle
▶ lab

The one operation in a distributed job that uses the network for data. Every row is assigned a destination by key, written to local disk, fetched across the cluster and merged — which is why it dominates the runtime, the cost and the failure modes of almost every job.

Q · Why is the `GROUP BY` the expensive part of my job when the filter above it reads ten times as many rows?
Narrow and Wide Transformations

Narrow: each output partition depends on one input partition, so the work stays where it is. Wide: it depends on many, so the data must move. This single distinction predicts every stage boundary in your job.

Q · Which operations in this transformation are free, and which one just made the engine move the entire dataset across the network?
Data Skew
▶ lab

Real key distributions are not uniform. When one value holds most of the rows, the partitioner faithfully sends them all to one task — and that task becomes the job.

Q · Every task in this stage finished in seconds except one, which has been running for forty minutes. Why, and what does the cluster size have to do with it?
Straggler Tasks

A job finishes when its slowest task does. One task out of a thousand taking twenty times as long makes the whole stage a twenty-times job, and no amount of extra capacity changes it.

Q · If 999 tasks finished in a minute and one is still running, how long is the job — and what would make it shorter?
Salting a Skewed Key

Split the dominant key into several artificial sub-keys so its rows land in several partitions, then combine the partials. It works, it costs an extra stage — and applied to every key instead of the hot one, it does nothing at all.

Q · One key holds most of the rows and I cannot change the grain or broadcast the other side. How do I make that work divisible?
Broadcast Joins

When one side of a join is small enough to send everywhere, the large side never moves and the shuffle disappears. The whole technique rests on a size estimate — and on what happens when that estimate is wrong.

Q · Why did the same join take minutes yesterday and hours today, with the same code and almost the same data?
Lazy Evaluation

Transformations build a plan; nothing runs until an action asks for a result. That is what lets the optimiser see the whole query — and why your error message points at the wrong line and your pipeline ran three times.

Q · Why did the error appear at `write()` when the mistake is twenty lines above it, and why did adding a debug `count()` double the job's runtime?
Query Optimizers

The same question has many correct executions with wildly different costs. An optimiser turns what you asked into how it will run — using rules it can always apply and statistics it can only sometimes trust.

Q · Two queries returning the same answer differ by orders of magnitude in cost. What decided that, and how much of it did I control?
Flink Concepts

A stream-first distributed processor: a dataflow graph deployed once, records flowing through stateful operators, with checkpoints instead of re-runs. Compared with batch and micro-batch on what each one makes easy — not on which is better.

Q · What changes when the job is a long-running dataflow instead of a scheduled batch, and which problems does that make easier or harder?

Query Engines

8 lessons

Engines that query data they do not own. Coordinators and workers, pushdown, vectorized execution, and the real limits of federating a query across systems.

Query Engines
▶ lab

Engines that answer SQL over storage they do not own — what that separation buys, and every guarantee it quietly hands back.

Q · What changes when the system planning your query is not the system that stores your data?
Distributed Query Execution
▶ lab

Coordinator to workers to sources to partial results to merge — and the four places a query dies that a single-node engine never has.

Q · What actually happens between submitting a SQL string and receiving the first row, when the work is spread across a coordinator and many workers?
Predicate Pushdown
▶ lab

Push the filter down to the reader so less is read at all — and learn the identical-looking query where it silently does not happen.

Q · My query filters to one day out of a year. Why did it read the whole year?
Projection Pushdown
▶ lab

Read only the columns the query needs. The cheapest optimisation a columnar format offers, and the one `SELECT *` throws away.

Q · The query needs two columns out of eight. Why did the reader fetch all eight, and what did that actually cost?
Source Pushdown
▶ lab

If the remote system can filter, aggregate or limit, do the work near the data and move less — and know exactly which of those your connector actually supports.

Q · The engine can ask a remote database for filtered, aggregated results, or it can pull the table and do the work itself. Which one is happening right now?
Federated Query
▶ lab

One SQL statement across several systems. Genuinely useful, and it gives up consistency, predictable latency, optimiser competence and control of the load you impose.

Q · If an engine can join a lake table to a production database and a SaaS export in one query, why would anyone still build ingestion?
Vectorized Execution
▶ lab

Operators that process a batch of column values per call instead of one row at a time — and why that changes what the CPU is able to do.

Q · Two engines run the same plan over the same columnar files. Why is one of them spending most of its time on work that has nothing to do with the data?
Batch and Streaming Unification
▶ lab

Modern engines let you express both with one API. The authoring surface converged; latency, state and completeness semantics did not.

Q · If the same SQL runs over a bounded table and an unbounded stream, has the distinction between batch and streaming gone away?

Data Quality

9 lessons

How do we know the data is correct enough to trust? Dimensions, tests, distribution checks, freshness and reconciliation — plus what every check still misses.

Data Quality

Every task green, every table populated, and the number still wrong. What "correct enough to trust" means, and why no single check establishes it.

Q · The run succeeded, the tables have rows and the dashboard renders. How do I know the data is correct enough to trust?
The Dimensions of Data Quality

Completeness, accuracy, freshness, uniqueness, validity, consistency — defined precisely, with how each is measured and which one is almost always asserted instead.

Q · When somebody says the data is "good quality", which of six quite different claims are they making, and which of them did anyone actually verify?
Data Tests
▶ lab

Assertions over rows and columns — not null, unique, non-negative, in a set, references valid — and the precise blind spot each one carries.

Q · Which assertions about a table are worth writing first, and what does each one still fail to notice?
Distribution Tests

Every row is valid, every type is right, every key is unique — and today holds a small fraction of a normal day. The checks that compare data with its own history.

Q · How do I detect data that satisfies every structural rule and is obviously wrong to anyone who has seen a normal day?
Freshness Checks

Expected latest data versus actual latest data — the cheapest check in the toolkit, two clocks that get confused, and the days it fires for no reason.

Q · How old is the newest data in this table, how old should it be, and which of those two questions is the dashboard actually answering?
Reconciliation

Count the rows and sum the measure at the source for a closed period, and compare with the serving table. The only check that observes both ends at once.

Q · Every internal check passes. How do I find out whether the number at the end of the pipeline still agrees with the system that produced it?
Quality Alerting

An alert nobody acts on trains people to ignore alerts. Severity from consumer impact, routing to the owner, and the difference between blocking a publish and sending a message.

Q · A check failed. Who should hear about it, how urgently, and should the data have been published at all?
The Data Quality Dashboard
▶ lab

One row per dataset — pipeline, freshness, completeness, status — and a hard rule that a green row is a statement about the checks you wrote, not about the data.

Q · What should a single screen show so that a consumer can decide, in five seconds, whether to trust the table they are about to query?
Who Owns Data Quality

The team that produces a field owns whether it is correct. A data team can measure and report. Placing the whole obligation downstream guarantees it fails.

Q · A column is wrong. Which team is accountable for it being right, and which team is merely the one who noticed?

Contracts & Schema Evolution

9 lessons

Producers and consumers agreeing explicitly. Which schema changes are safe, which break silently, and why a change that passes every schema check can still destroy a metric.

Data Contracts

An explicit, owned, enforced agreement between the team that produces data and the teams that depend on it — covering names, types, nullability, meaning, freshness and how it may change.

Q · What has the producing team actually promised about this dataset, and who finds out first when the promise stops being true?
Schema Evolution

Schemas change constantly. Adding, removing, renaming and retyping a field are four different risks with four different blast radii — and only one of them is routinely safe.

Q · A field is about to change upstream. Which consumers break, which keep working, and which keep working while producing the wrong answer?
Backward Compatibility

The producer ships first: data written under the new schema must still be readable, and still correct, for consumers that have not upgraded. State it as writer-and-reader, because the word itself is used in opposite directions by different communities.

Q · If the producer deploys its schema change today and no consumer changes anything, does every consumer still get a correct answer tomorrow?
Forward Compatibility

The consumer ships first: data written under the old schema must still be readable, and still correctly interpreted, by code running the new one. In analytics this is not an edge case — every query over history is this question.

Q · If the consumer upgrades its schema today, can it still read the years of data that were written before the change — and will it interpret them the way it should?
Schema Registry

A shared, versioned store of schemas with a compatibility gate in front of it. It makes structural evolution mechanical — and it has nothing to say about meaning, ownership or the consumers reading your data by some other path.

Q · Where does a producer's schema live so that a consumer can resolve it, and what can that place actually refuse?
Breaking Schema Changes
▶ lab

A numeric field starts arriving as a string. Some consumers error; the dangerous ones cast, get null, keep every row, and report zero — with completeness, uniqueness and freshness all green.

Q · When a field's type changes upstream, which consumers fail loudly, which fail quietly, and what does the dashboard show while nobody is being paged?
Semantic Changes

The schema is identical, every type checks, every test passes, and the number now means something else. `revenue` went from gross to net. No tool will ever detect this — only documented semantics, an owner and a changelog will.

Q · A field's name, type and nullability are unchanged and its values have shifted. How would anyone find out that its definition changed rather than the business?
Nullability & Defaults

Making a field nullable is a breaking change for everyone who assumed it was not. A default hides missing data behind a plausible value. And "unknown", "not applicable" and "the pipeline dropped it" are three different facts stored identically.

Q · This column contains a null. Does that mean the value is unknown, that it does not apply, or that something in the pipeline lost it — and can anyone downstream tell?
Contract Enforcement

Where the check actually runs — producer CI, the ingestion boundary, the entry to transformation — and the trade every enforcement point makes: a silent wrong number becomes a loud failure, which is correct and will still page someone.

Q · At which point in the pipeline does a contract violation stop the data, who gets woken up when it does, and what happens to the batch that was refused?

Metadata, Catalog & Lineage

8 lessons

Data about data, and the graph that connects it. Discovery, ownership, column-level lineage and impact analysis — the difference between a warehouse and a landfill.

Metadata: Technical, Operational and Business

Schema, owner, description, freshness, lineage, tags and quality — split by where each comes from, because that is what predicts which of them is still true.

Q · What do you have to know about a dataset before you are willing to put its numbers in front of someone who will act on them?
The Data Catalog

Four questions it must answer, and the honest failure mode: a catalog nobody populates is worse than no catalog, because it looks authoritative.

Q · Which dataset contains customer revenue, who owns it, can I trust it, and how fresh is it — and where does someone go to find out?
Data Lineage

orders DB to stg_orders to fct_orders to revenue_daily to the executive dashboard — and why that graph is a debugging tool rather than documentation.

Q · A number on a dashboard looks wrong. What produced it, what produced that, and where does the walk stop?
Column-Level Lineage

orders.amount to revenue to monthly_revenue. Much harder to produce than table-level lineage, and the only granularity that answers the question an incident actually asks.

Q · This one column is wrong. Which upstream columns did it come from, and which of them do I have to check?
Impact Analysis

The same graph read the other way. If I change this column, what breaks — answered before the change rather than discovered afterwards.

Q · I am about to rename, retype or drop this column. Who depends on it, and which of them will fail loudly rather than silently?
Data Ownership

Every important dataset has a clear owner. The failure to design against is "nobody knows where this table came from" — and it is an organisational problem with a technical trigger.

Q · This dataset is wrong at 03:00. Who is accountable for it, and what exactly did they agree to?
Data Discovery

How someone finds the right dataset among hundreds. Search over descriptions fails; search over what people actually query works.

Q · A new analyst needs quarterly revenue by country. How do they find the right table among four hundred, and not the plausible wrong one?
Dataset Documentation

Documentation generated from the transformation graph stays true. Documentation written separately does not — and the distinction decides what is worth writing down at all.

Q · Which parts of a dataset's documentation will still be true in a year, and which will quietly become lies?

Governance, Privacy & Access

9 lessons

Classification, PII, minimization, retention, access control, masking and deletion — applied to datasets and pipelines rather than to endpoints.

Data Governance

Ownership, classification, access, retention and auditability as five mechanisms with enforcement points — not as a document in a wiki.

Q · For any table in the warehouse, can you answer who owns it, what class of data it holds, who may read it, how long it is allowed to exist, and who read it last week?
Data Classification

Public, internal, confidential, personal, highly sensitive — what the tiers mean, why the unit is the column, and why classification is worthless unless it propagates.

Q · What class of data does this column hold, who decided that, and does every column derived from it carry the same answer?
PII in Pipelines

Where personal data actually ends up in a data platform: raw landing zones, debug logs, error messages carrying rows, notebook extracts, training sets, and the temporary table nobody deleted.

Q · If a regulator asked you to list every place in your platform where this customer's email address exists, could you produce the list?
Data Minimization

Store only what is needed — against the equally correct rule that says keep everything because you cannot recreate it. Both are right, and the resolution is structural.

Q · Do we need to store this field at all, and how do we square that with the rule that says never throw away raw data?
Data Retention

How long should this dataset exist? A retention horizon is simultaneously a recovery window and a liability window, and the two want opposite numbers.

Q · How long should this dataset exist, and what stops working on the day it is deleted?
Data Access Control

Least privilege applied to five surfaces — warehouse, lake, catalog, pipelines and secrets — where the weakest one is the effective policy and the pipeline is the most over-privileged principal you have.

Q · Who can read this dataset, through every path that reaches its bytes, and how would you find out?
Row and Column Security

An analyst sees EU rows only; a column comes back masked. Where that policy is evaluated decides whether it is a control or a convention — and a row filter silently changes what an aggregate means.

Q · When two analysts run the same query and get different numbers because of a row filter, which one is wrong?
Data Masking, Tokenisation & Encryption

Four different techniques that people call masking. Which joins survive, who can reverse it, and why hashing a low-cardinality field is reversible by anyone with a loop.

Q · This column must not be readable, but analysis still needs it — which transformation do you apply, and who can undo it?
Deletion Requests

A person asks to be erased from a platform built on immutable files, replayable logs and forty copies — and the backfill you run next week can bring them back.

Q · A subject requests erasure. What actually has to happen, how do you prove it did, and what stops a replay from resurrecting them?

Data Observability

8 lessons

Pipeline health is not data health. Freshness, volume, schema and quality as monitored signals, and the upstream walk that turns "revenue looks wrong" into a cause.

Data Observability

Pipeline health and data health are two different systems. A platform that watches only the first finds almost none of the incidents anyone cares about.

Q · Every task has been green for a month and finance says the quarter is wrong. What should have been watching, and what was it watching instead?
Pipeline Observability

What an orchestrator genuinely knows, what it structurally cannot know, and how to make a task-level signal say something about data.

Q · The DAG is green. Precisely which claims about my data does that entitle me to make?
Pipeline Metrics

Rows processed, bytes processed, duration, failures, retries and lag — what each one detects, what moves it for boring reasons, and what none of them can see.

Q · Which six numbers, recorded per run, would let me tell a broken pipeline from a busy one without opening a log?
Freshness Monitoring

Freshness is a per-dataset property. Averaging it across a platform hides the one table that has not updated since Friday — and the false-positive rate decides whether anyone still reads the alert in six months.

Q · How old is the newest complete record in this dataset, and how old is it allowed to get before someone should be told?
Volume Anomalies

Comparing today with the same weekday historically is the cheapest broad detector there is — and it misses every error that preserves row count, which is most value-level bugs.

Q · Does the number of rows that arrived today look like the number that normally arrives on a day like today?
Data Incidents

A dashboard says revenue dropped eighty percent overnight. Seven different causes produce that symptom, and telling them apart is the job.

Q · Revenue on the executive dashboard is down eighty percent since yesterday. Before touching anything, what could produce exactly that symptom?
Debugging a Data Incident
▶ lab

Consumer symptom to serving dataset to transformation to upstream dataset to ingestion to source. Debug upstream, always — and diagnose from the set of checks that failed, not from the first one.

Q · The number is confirmed wrong. What is the sequence of questions that turns that into a cause, and in which direction do I walk?
Lineage Debugging
▶ lab

Click a dashboard metric and walk it back — tile, metric definition, mart, model, staging, raw, change capture, production database — then turn around and ask what else this feeds.

Q · Where did this number come from, and if the table behind it is wrong, what else is wrong right now?

Backfills & Reprocessing

10 lessons

Fixing history without breaking the present. Backfill ranges, late-arriving data, deduplication, merges, replay and the validation that has to happen before you publish.

Backfills

Recomputing history after the logic or the inputs changed — and why the hard part is publishing the result, not computing it.

Q · The revenue model has been miscounting refunds for six months. The fix is merged and today is correct. What does it take to make those six months right?
What Backfills Break

Duplicated periods, overwritten current data, a saturated warehouse and a source knocked over by its own history — the four ways a correction becomes an incident.

Q · A backfill re-ran a range that was already populated. Every task succeeded. What is now wrong, and which check would have said so?
Planning a Backfill
▶ lab

Five questions to answer before the first partition runs: which range, is the re-run safe, where does the compute go, how do we validate, and how do we publish.

Q · Before a single historical partition is recomputed, what has to be decided — and which of those decisions is irreversible once the run starts?
Validating a Backfill Before You Publish

Reconcile the range against the source, explain every old-versus-new difference, and prove a period the bug never touched is unchanged — the check people skip.

Q · The recomputed range is sitting in staging. What has to be true before it is allowed to replace what consumers are reading?
Reprocessing vs Retrying

The same button means two different things: finishing work that never completed, and redoing work that completed and is now wrong.

Q · A task in yesterday's DAG is red and a task in March's DAG is green but wrong. Both are cleared and re-run with the same command. Why is only one of them safe?
Late-Arriving Data

An event that happened on Tuesday and arrived on Thursday, after Tuesday was already computed, published and read.

Q · A record belonging to a partition you closed three days ago has just landed. Where does it go, and who has to be told that Tuesday changed?
Deduplication

Which key you deduplicate on decides which duplicates you can see — and a producer retry with a fresh id is invisible to every id-based scheme.

Q · The same order appears twice in the fact table. Which of the two copies is wrong, and which key would have told you they were the same thing?
Upserts and Merges

Replacing rows by key instead of appending them — the write that makes re-running safe, and the assumptions it quietly depends on.

Q · What has to be true for running the same load twice to leave the table in exactly the state one run would have produced?
Full Refresh vs Incremental

Rebuild everything every time, or process only what changed. The first is expensive and has no state to get wrong, and it is the right answer more often than people admit.

Q · Should this model recompute all of history on every run, or only the rows that changed — and what does the second one oblige you to track forever?
Replay from the Log

Re-reading a retained event log versus recomputing from the raw layer — two recovery paths with different windows, different guarantees, and retention as the hard boundary on both.

Q · A consumer has been broken for three days. Do you replay the log, rebuild from raw, or re-snapshot the source — and which of those is still available?

Pipeline Reliability

8 lessons

Retries, checkpoints, atomic publish, partial failure and rollback — plus the SLOs that make freshness a commitment instead of a hope.

Pipeline Reliability

Reliability is not a low failure rate. It is seven mechanisms — retries, idempotency, checkpoints, atomic publish, validation, rollback, reprocessing — that are only safe as a set.

Q · The nightly pipeline ran 340 times last month and failed twice. Is it reliable?
Atomic Publish

A consumer must never read a half-written dataset. Build somewhere they are not looking, validate it there, then make it visible in one operation — and know which of the available operations is genuinely one.

Q · A query runs at 02:14 while the nightly load is halfway through rewriting `fct_orders`. What does it see, and what should it have seen?
Checkpointing

A restarted job has to resume from somewhere. A checkpoint is correct only if it records the input position and the computed state together, in one atomic action — otherwise it is a dual write wearing a reliability hat.

Q · A stateful streaming job is killed mid-window and restarted. Where does it resume, and what has to have been saved for the answer to be correct?
Partial Failure

Ninety-eight partitions succeeded and two failed. Re-running only the two is right — but only if the unit is idempotent and independently publishable, and most people check neither before doing it.

Q · A run processes a hundred partitions and two of them fail. What is the correct next action, and what has to be true for it to be safe?
Retries in Pipelines

Retrying a task that already published is not a retry — it is a second publish. Retry is safe exactly when the task is idempotent, and a uniform retry policy applied to tasks that are not uniformly idempotent is the honest failure here.

Q · A task times out after its write committed. The orchestrator retries it. What just happened to the data?
Pipeline SLOs
▶ lab

A published, measured promise about a dataset — when it arrives, how fresh it is, how often it is right — agreed with the people who depend on it rather than declared by the team that runs it.

Q · What exactly are we promising the people who read this table, and how would either of us know the promise was broken?
The Freshness SLO
▶ lab

Now minus the event time of the newest **complete** data. The word "complete" does all the work: a table holding a few hours of today is extremely fresh and completely wrong to aggregate.

Q · A consumer asks how fresh this table is. What number do you give them, and what has to be true for that number to mean anything?
Rolling Back Data
▶ lab

Reverting the transformation code does not revert the tables it wrote. A data rollback is either a restore from a retained snapshot or a re-run of the previous logic over the affected range — and both of them are forward operations.

Q · A bad model shipped four hours ago and has been overwriting a fact table ever since. What does "roll it back" actually mean, and what is still wrong after you have done it?

Cost Engineering

6 lessons

Data platforms get expensive quietly. The drivers — bytes scanned, bytes shuffled, bytes retained, hours held, work repeated — and the design decisions that move each one.

What Actually Drives Data Platform Cost

Storage, scans, shuffle, compute hours, network, retention, file count and repeated work — put in the order they actually move the number.

Q · A platform's spend grew faster than its data did. Which drivers moved, and how would you find out which one rather than guessing?
Scan Cost
▶ lab

What a query actually has to read, and why column selection and partition pruning are the two cheapest fixes in the entire domain.

Q · Two queries return the same three numbers. One reads a single day of two columns and the other reads a year of everything. What in the SQL decides which one you wrote?
Compute Waste

Rebuilding history that did not change, refreshing models nobody reads, holding capacity nobody uses, and shuffling data that did not need to move.

Q · Your platform spends most of its compute recomputing things that have not changed. How would you prove that, and which of the four shapes of waste is dominant?
Storage Lifecycle

Hot to warm to cold to archive to deleted, driven by how the data is actually read — and the retrieval cost that makes archive a trap for anything you might read again.

Q · Which of your data has not been read in a year, and what would it cost you — in money you cannot see and in latency you have not measured — to have put it somewhere cheaper?
Cost Attribution

You cannot manage what you cannot attribute — and in a shared platform every cost belongs to everyone, which means it belongs to nobody.

Q · A shared warehouse serves eleven teams. Which of them caused this month's increase, and what would it take to answer that without starting an argument?
Cost vs Freshness
▶ lab

The most direct trade in the platform: every increment of freshness is bought with compute that runs more often, longer, or continuously. The right freshness is set by the decision the data drives, never by what the stack can achieve.

Q · A consumer asks for this dataset to be fresher. What exactly gets more expensive, and what decision would have to change for that to be worth it?

Data Architecture Patterns

9 lessons

Central warehouse, event-driven platform, Lambda, Kappa and mesh, compared by what problem each was a response to and what it costs an organisation to run.

Data Architecture Patterns
▶ lab

Central warehouse, event-driven platform, Lambda, Kappa and mesh — sorted onto the two independent axes they actually live on, and compared by the problem each was a response to.

Q · Each of these patterns has a name, a diagram and an advocate. Which problem was each one solving, and which of those problems do I actually have?
The Central Warehouse
▶ lab

The arrangement most organisations actually run, taken seriously: one team, one place, one definition — with a real advantage and a specific failure mode that arrives with source count rather than with data volume.

Q · One team ingests everything, models everything and serves everyone. What does that genuinely buy, and at what point does it stop working?
The Event-Driven Data Platform
▶ lab

Everything publishes events; consumers subscribe independently. It buys decoupling, replay and many materialisations of one stream — and it moves duplicate, ordering and schema handling from one place into every consumer.

Q · If every system publishes its changes to a shared log instead of being queried, what does that decouple — and what does each consumer now have to solve on its own?
Lambda Architecture
▶ lab

A batch layer that is authoritative but late, a speed layer that is fresh but provisional, and a serving layer that merges them — bought with two implementations of the same logic that must agree forever.

Q · If the batch result is trusted and hours old while the streaming result is immediate and approximate, can a platform serve both from one interface — and what does maintaining both cost?
Kappa Architecture
▶ lab

One event log, one stream processing path, and reprocessing by replay. It removes Lambda's duplicated implementation and replaces it with two demands: the log must retain everything you might reprocess, and the stream job must replay history at a rate batch used to manage.

Q · If reprocessing is just replaying the same job from the start of the log, do you still need a batch layer — and what has to be true for that replay to be possible?
Data Mesh
▶ lab

An organisational model, not an architecture: domain ownership, data as a product, a self-service platform and federated governance — with the operational cost of each stated honestly.

Q · If the central team cannot hold the meaning of a hundred source systems, what has to change organisationally for the teams that do hold it to publish trustworthy data themselves?
Data Products
▶ lab

Owner, schema, semantics, quality, documentation, SLO, access policy. Seven commitments, and what a team has to start doing on the day it makes them.

Q · A team publishes a table that other teams read. What has to be true before that table is a product rather than a shared file with a name on it?
Data Platform Engineering
▶ lab

Eight shared capabilities — ingestion, storage, compute, orchestration, catalog, quality, security, observability — and the boundary question that decides whether the platform team is a substrate or a queue.

Q · Which part of a data pipeline should a central platform team own, and which part must be owned by the team that knows what the data means?
The Self-Service Data Platform
▶ lab

An engineer declares a source and a model; the platform produces a pipeline, tests and monitoring. Get it wrong in one direction and it is a ticket queue with extra steps; get it right and you have four hundred datasets nobody owns.

Q · What must a domain engineer be able to do at 22:00 on a Friday without another human being involved — and what happens to a platform where they can do all of it?

Platforms & Cloud Services

8 lessons

The primitives first, then how BigQuery, Snowflake, ClickHouse, DuckDB and the managed streaming services realise them — architecturally, not from a feature list.

Cloud Data Services
▶ lab

A data platform is assembled from about seven primitives. Every cloud sells all seven under different names, and the names are the least interesting part of the comparison.

Q · Your platform runs on one provider and someone asks what the equivalent service is on another. What does "equivalent" have to mean before that question has an answer?
Comparing Analytical Warehouses
▶ lab

Six axes that actually separate analytical warehouses — architecture, storage/compute coupling, latency profile, concurrency model, cost-model shape and workload fit — and why a product name is the last thing to decide.

Q · Three teams recommend three different warehouses. What are you comparing them on, before anyone runs a benchmark?
BigQuery Concepts
▶ lab

A serverless analytical engine: columnar storage you do not manage, compute allocated per query rather than provisioned, and exactly two physical knobs — partitioning and clustering — carrying all the layout weight.

Q · There is no cluster to size, no node to add and no index to create. What is left that decides how much a query reads and how long it takes?
Snowflake Concepts
▶ lab

Three separated layers — immutable columnar storage, independently sized compute clusters, and a services layer that holds all the metadata — and what that separation actually buys, which is isolation and elasticity rather than speed.

Q · Which of a warehouse's three jobs — holding bytes, running queries, and knowing what exists — decides whether a query reads most of a table or almost none of it?
ClickHouse Concepts
▶ lab

A columnar OLAP database built for logs, events and real-time aggregates: immutable sorted parts merged in the background, a sparse index over granules, and a sort order that decides almost everything.

Q · You need aggregates over billions of event rows fast enough that a human keeps clicking rather than waiting. What makes that possible, and what did you agree to give up for it?
DuckDB Concepts
▶ lab

An analytical database that runs inside your process. No network in the hot path, no cluster, no concurrency story — and that combination changes what a pipeline stage costs, not just how fast a query is.

Q · What changes about a data pipeline when the analytical database is a library in your process rather than a service across the network?
Managed Streaming Platforms
▶ lab

Managed Kafka, Kinesis, Pub/Sub and Event Hubs are all realisations of the same primitive — a durable, replayable log. The axis on which they genuinely differ, and the one that changes your design, is ordering.

Q · Four managed services all give you a durable stream that many consumers can read independently. Which of their differences will actually force you to change your pipeline?
Choosing an Analytical Platform
▶ lab

Eight questions that turn "which warehouse should we use" into a list of required capabilities, two or three candidate architectures, and the trade-off each one asks you to accept. The output is never a single product.

Q · Someone asks which analytical platform to adopt. What do you have to know before that question has an engineering answer rather than a preference?

Data Engineering for AI & Agents

9 lessons

Retrieval corpora, embeddings, evaluation sets and agent traces are data products with schemas, freshness, lineage and cost. Re-embedding is a data migration.

Data Engineering for Agents
▶ lab

An agent system is a data platform with a model in the middle: six datasets, each with a grain, an owner, a freshness target, and its own quiet way of rotting.

Q · An agent gave a customer the wrong answer on Tuesday. Which datasets did it read, which did it write, and who owns each one?
The LLM Data Pipeline
▶ lab

Documents to ingest to clean to chunk to metadata to embed to index to retrieval. Nine stages, nine promises, and most retrieval failures happen in the first three.

Q · A PDF lands in a shared drive. What has to happen, in what order, before an agent can retrieve one sentence from it — and what does each of those steps actually promise?
Chunking Pipelines
▶ lab

Chunking is not preprocessing and not a hyperparameter. It is the grain declaration for the retrieval index, and a boundary in the wrong place is the same class of error as a wrong fact-table grain.

Q · What does one row of your retrieval index represent — and which questions does that choice quietly make unanswerable?
Embedding Pipelines
▶ lab

Turning a corpus into vectors is a batch job with a metered external call in the middle. Keyed sink, watermarked input, work queue derived by difference — or it will not finish.

Q · Ten million chunks need vectors. How do you run that as a restartable, idempotent, cost-bounded batch job rather than a loop that dies at sixty per cent?
Re-embedding
▶ lab

A new embedding model makes every vector in the corpus stale. Recompute beside the old index and switch atomically — this is a data migration, and it obeys backfill rules exactly.

Q · The embedding model changes. What has to happen to a corpus of vectors, and why is that the same operation as any other backfill?
Vector Data Engineering
▶ lab

A vector is a row in a derived dataset. Source version, chunk strategy, embedding version, text hash and reindex status are the columns that make a corpus debuggable, rebuildable and governable.

Q · What has to sit beside a vector for a corpus to be explainable a year later — and which questions become permanently unanswerable for each column you did not write?
Evaluation Data Pipelines
▶ lab

Production traces, sampled, privacy-filtered and versioned into an evaluation dataset. The privacy filter is the step most often skipped, and the version is what makes a score comparable across runs.

Q · Where does an evaluation set come from, and what makes this month's score comparable with last month's?
Agent Observability Data
▶ lab

Prompt, model, tool calls, latency, tokens, outcome and feedback — as a high-cardinality event table with a classification and a retention policy, not as logs in a bucket.

Q · What has to be recorded about an agent run for it to be explainable a week later, and how much of what makes it explainable is the customer's own words?
Feature Pipelines
▶ lab

Raw events to transformations to features to two consumers. The characteristic failure is one logical column computed by two pipelines, and it is a data-engineering failure with a data-engineering fix.

Q · The same feature is computed by a batch job for training and by a service at request time. What makes those two numbers differ, and how would you find out?

Debugging Data

8 lessons

The dashboard is wrong. Working from a number back to its source through models, joins, partitions and ingestion — and the anti-patterns that made it wrong in the first place.

Where Did This Number Come From?

The domain's closing question. Ten things you have to be able to answer about a figure before you are entitled to act on it — and what it means when you cannot answer one.

Q · A tile on the executive dashboard reads 1,245,892. Which model produced it, at what grain, from which authoritative source, through which transformations — and could you reproduce it tomorrow?
Two Dashboards, Two Numbers

Finance and growth disagree about revenue. Both queries are correct. This is almost always a governance failure wearing the costume of a bug.

Q · Two teams report yesterday's revenue as 1,245,892 and 1,318,440 from the same warehouse, and both SQL statements are correct. Which one is wrong?
Missing Rows

The report is low, no task failed, and the source database still has every record. Working from a shortfall back to the arrow that dropped it.

Q · Yesterday shows materially fewer orders than the equivalent day last week, every DAG task is green, and the source system has all of them. Where did the rows go?
Duplicate Rows

Revenue is up, nothing launched, and every check is green except uniqueness. Inflation is the failure people question least and notice last.

Q · A measure jumped overnight with no product change, no marketing push and no failed task. Which of the five duplication mechanisms produced it, and why did only one check notice?
Stale Dashboards

A complete, plausible, internally consistent number for a day that ended two days ago. The failure mode that looks most like health.

Q · The dashboard renders a full set of numbers for "yesterday" and nothing on the page says when the data was last updated. How would anyone know it is Tuesday's?
The Pipeline Succeeded. The Data Is Wrong.
▶ lab

The domain's thesis, turned into a diagnosis. A green DAG proves the code ran; eight faults, six checks and the distinct fingerprint each one leaves are what prove anything else.

Q · Every task in last night's run exited zero, inside its timeout, with no retries. What does that prove about the rows in the serving table?
Data Engineering Anti-Patterns
▶ lab

Sixteen decisions that were reasonable when they were made and expensive by the time anyone noticed. Each one gets the argument for it before the argument against.

Q · Every one of these was chosen deliberately by a competent engineer under a real constraint. What changed between then and the day it became the reason nobody trusts the platform?
Data Platform Anti-Patterns
▶ lab

The six failures that are organisational rather than technical. None of them is visible in a query plan, all of them are cheap in a small company, and each is what a large one means when it says the data cannot be trusted.

Q · Nothing in the platform is technically wrong, every pipeline works, and nobody trusts the data. What is the organisation doing that no engineering fix will reach?

Cross-Domain Connections

7 lessons

Where this domain touches databases, distributed systems, backends, cloud, delivery, observability and security — and exactly where each of those owns the depth.

Data Engineering and Database Engineering

The seam is the write-ahead log. Almost every mechanism a source database uses to stay correct decides what a pipeline downstream of it is able to promise.

Q · Which parts of database internals does a data engineer genuinely have to understand, and which are somebody else's depth?
Data Engineering and Distributed Systems

A pipeline does not choose its guarantees. It inherits them from the weakest hop, and most pipeline bugs are a distributed-systems property arriving where nobody expected it.

Q · Which distributed-systems guarantees does a data pipeline actually depend on, and what breaks when they do not hold?
Data Engineering and Backend Engineering

The backend produces transactions, events and logs as a side effect of serving users. We are its downstream consumer, and it usually does not know that.

Q · What does a data platform need from the services that produce its data, and what is unreasonable to ask of them?
Data Engineering and Cloud Infrastructure

A data platform is assembled almost entirely from four cloud primitives. Knowing which four, and what each actually charges you for, is most of platform engineering.

Q · Which cloud primitives is a data platform actually built from, and which decisions about them are irreversible?
Data Engineering and DevOps

Transformation code deploys like software. The tables it already wrote do not, and that asymmetry is the whole lesson.

Q · What does it mean to deploy, version and roll back a change when the artefact is not a service but a table full of history?
Data Engineering and Observability

Observability & Performance owns why it is slow. This domain owns whether it is correct, complete and fresh. Different questions, different signals, different toolkits.

Q · Why is monitoring a data platform a different discipline from monitoring a service, and which signals belong to which?
Data Engineering and Security

A pipeline is a machine for making copies. Every copy inherits the original's obligations and none of the mechanisms that were enforcing them.

Q · What changes about access, classification, retention and deletion once data leaves the system that was protecting it?