MLOps & Data Engineering

Module 4 of 18

Module 4: ETL & ELT Pipelines

5 min read869 words
What you'll learn
Explain the Extract, Transform, Load stepsCompare ETL with ELT and know when to use eachDescribe idempotency and why it mattersRecognize what makes a pipeline robust

"Extract, Transform, Load — three little words that describe how nearly all data gets from where it is to where it's useful."

Level: Intermediate · Time: ~3 days · Prerequisites: Modules 2–3

Learning Objectives

By the end of this module, you will be able to:

  • Explain the Extract, Transform, Load steps
  • Compare ETL with ELT and know when to use each
  • Describe idempotency and why it matters
  • Recognize what makes a pipeline robust

1. The Three Steps

Almost every data pipeline does three things:

  1. Extract — pull data from sources (databases, APIs, files).
  2. Transform — clean, reshape, join, and enrich it.
  3. Load — write it to a destination (warehouse, lake, database).

Explain like I'm new: It's like making a fruit salad. Extract: gather fruit from the fridge. Transform: wash, peel, chop. Load: arrange it in the serving bowl. Data pipelines follow the same three moves.

2. ETL vs ELT

The difference is when you transform:

ApproachOrderBest when…
ETLTransform before loadingStorage is limited; you want only clean data stored
ELTLoad raw first, transform inside the warehouseStorage is cheap and the warehouse is powerful (modern default)

Concept: Cloud warehouses made ELT popular: dump raw data in cheaply, then transform it with the warehouse's own horsepower. You keep the raw data (great for re-processing later) and transform on demand.

The practical payoff of keeping raw data shows up when requirements change. Say you loaded raw web logs and transformed them into a "sessions" table. Six months later the analytics team redefines what counts as a session. With ETL, the raw detail was discarded during transformation, so you're stuck. With ELT, the raw logs are still sitting in the warehouse — you just rewrite the transformation and re-run it over history. Cheap storage buys you the freedom to change your mind.

3. Idempotency: Run It Twice, Same Result

Pipelines fail and get re-run. An idempotent pipeline produces the same correct result whether it runs once or five times — no duplicate rows, no double-counting.

Common mistake: Writing a pipeline that appends data every run. Re-run it after a hiccup and you've now got duplicates corrupting every downstream report. Design so re-running is always safe (e.g., replace a partition rather than blindly append).

Explain like I'm new: Idempotency is like a well-designed light switch. Flip it "on" once or flip it "on" five times — the light is still just on. A badly designed pipeline is like a button that adds a lamp every time you press it: press it twice by accident and now you've got two lamps you didn't want. The goal is switches, not lamp-adding buttons.

4. What Makes a Pipeline Robust

  • Error handling — retries and clear failure messages, not silent breakage.
  • Logging & alerts — you find out about problems before users do.
  • Data validation — check the data looks right before loading (Module 10).
  • Incremental loads — process only new data, not everything, every time.

Incremental loads deserve a closer look, because they're where robustness meets efficiency. A naive pipeline reprocesses the entire history every night — fine when there are a thousand rows, ruinous when there are a billion. An incremental load asks "what's new or changed since last time?" and touches only that slice. Done well, it's both faster and safer: less data moved means less to go wrong, and a clear notion of "the new part" makes re-running a single day straightforward.

Try this: Imagine your pipeline crashes halfway through tonight's run. What happens when it restarts? If the answer is "duplicates" or "corrupt data," it isn't robust yet — that thought experiment is how engineers harden pipelines.

5. From Scripts to Systems

A quick script becomes a real pipeline when it's automated, monitored, and reliable. The next module (Airflow) is about orchestrating these steps — scheduling them, ordering them, and recovering when something fails.

Concept: Transformation is where most of the value — and most of the bugs — live. Cleaning messy real-world data (missing values, wrong types, duplicates) is unglamorous but decisive for everything downstream.

✅ Checkpoint

  1. What do the three letters in ETL stand for?
  2. How does ELT differ from ETL, and why did ELT become popular?
  3. Why must a pipeline be idempotent?

Answers: 1) Extract, Transform, Load. 2) ELT loads raw data first and transforms inside the warehouse; cheap cloud storage and powerful warehouses made it the modern default. 3) So re-running after a failure produces the same correct result instead of duplicates or corruption.

Key Takeaway: Pipelines Extract, Transform, Load data from sources to destinations. ETL transforms before loading; ELT loads raw then transforms in a powerful cloud warehouse (the modern default). Robust pipelines are idempotent (safe to re-run), with error handling, logging, validation, and incremental loads. Transformation is where the value and the bugs concentrate.

Further Learning

Part of "MLOps & Data Engineering." Original content for this learning platform.