$ etl run nightly_sales --date 2026-11-15
ETL
ETL (Extract, Transform, Load) is a data integration pattern that pulls data out of source systems, cleans and reshapes it in a separate processing engine, and only then loads the finished result into a target such as a data warehouse. The warehouse never sees raw data: it receives tables that are already deduplicated, typed, joined and ready for reports.
ETL is the classic pattern from the era when warehouse compute was expensive and limited. Today ELT is the default for analytics, but ETL is still the right call when data must be filtered, masked or validated before it is allowed into the target.
How it works
$ etl run nightly_sales
Extract, transform in staging, then load
- Three sources: an orders database, a CSV of stores dropped on SFTP, and an API with exchange rates. One warehouse table is the goal.
- Extract: the job pulls yesterday's rows from each source into the engine's staging area, usually on a nightly schedule.
- Transform: clean, deduplicate, join and mask, all outside the warehouse, in Spark, Python or an ETL tool.
- Load: only the finished, modeled rows are written to the warehouse. Analysts never see the mess.
- The cost: raw data usually isn't kept, so a new business rule means re-extracting history from the sources, if they still have it.
The three steps
- Extract: read from databases, files, APIs and SaaS tools. Prefer incremental extraction (only rows changed since the last run, using an
updated_atcolumn or CDC) over full dumps, and read from a replica so the production database isn’t slowed down. - Transform: cleansing (nulls, bad formats), standardizing (units, currencies, time zones), deduplication, joins and lookups, aggregation, and business rules such as “a cancelled order doesn’t count as revenue”.
- Load: write to the target. Make it idempotent: re-running the job for 2026-11-15 should replace that day’s data, not append it twice. Use
MERGE/ upsert or overwrite-by-partition.
ETL vs ELT
| ETL | ELT | |
|---|---|---|
| Where transforms run | Separate engine (Spark, ETL tool) | Inside the warehouse (SQL, dbt) |
| What lands in the target | Clean, modeled tables | Raw copies first, models on top |
| Re-processing history | Re-extract from sources | Re-run SQL on stored raw data |
| Sensitive data | Can be masked before it lands | Lands raw, must be secured in place |
| Best fit | Strict compliance, heavy non-SQL logic, small or legacy targets | Cloud warehouses and lakehouses |
When ETL is still the right choice
- PII or regulated data that may not be stored unmasked in the analytics platform.
- Heavy non-SQL work: parsing binaries or documents, ML feature extraction, image or geo processing.
- Targets that can’t transform: an operational database, a search index, a small on-prem warehouse.
- Reducing volume: aggregating billions of IoT readings before loading saves storage and cost.
Common mistakes
- Non-idempotent loads that append duplicates when a job is retried.
- Full extracts every night of tables that only change by 1 percent.
- No data quality checks between transform and load, so bad data is published silently.
- Business logic hidden in a GUI tool with no version control or tests.
Learning Resources
Books
- The Data Warehouse ETL Toolkit: Ralph Kimball and Joe Caserta
- Fundamentals of Data Engineering: Reis and Housley
- Understanding ETL: Matt Palmer
Articles and videos
- AWS: What is ETL?
- Databricks: Extract Transform Load
- Functional Data Engineering: Maxime Beauchemin, on idempotent, partition-based loads
- What is ETL with a clear example
See also: ELT, Pipeline Orchestration