Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Ingestion and Pipelines  ›  Lesson

ETL and ELT

Extract Data 12 minPipelines extract, transform and load data, and ETL transforms before loading while ELT loads raw data first and transforms it inside the warehouse, keeping the raw data for replays.

ETL and ELT

Every PedalCity pipeline does three things: it takes data out of a source, reshapes it, and puts it somewhere useful. The only question is the order of the last two. That order has a name, and it shapes the whole platform.

The rule

ETL shapes data before loading; ELT loads raw data first, then shapes it inside.

The three steps:

  • Extract: read data from the source, such as the app database, the payments API or sensor files.
  • Transform: clean, deduplicate, convert types and time zones, join, apply business rules and summarise.
  • Load: write the result into the target, usually a warehouse or lake.

In ETL, transformation happens on a separate processing server before loading. Only finished tables reach the warehouse. This was the norm when warehouse compute was expensive.

In ELT, raw data is loaded first into staging tables, and transformation runs inside the warehouse, usually as SQL:

-- T happens after L, inside the warehouse
CREATE TABLE fact_rides AS
SELECT r.ride_id,
       CAST(r.ended_at AT TIME ZONE 'Asia/Kolkata' AS DATE) AS ride_date,
       r.start_station AS start_station_id,
       r.fare,
       EXTRACT(EPOCH FROM r.ended_at - r.started_at) / 60 AS duration_min
FROM stg_rides AS r
WHERE r.ended_at IS NOT NULL;

Modern cloud warehouses have cheap, scalable compute, so ELT is now the common default. Tools such as dbt manage these SQL transformations as version-controlled code. ELT's biggest gift is that the raw data stays. When a business rule changes, you rerun the SQL over the raw staging data instead of extracting months of history again.

ETL still wins in some cases:

  • Sensitive data that must never land in the warehouse, such as full card numbers, which should be masked before loading.
  • Heavy non-SQL work, such as parsing binary sensor files or images.
  • Targets with little compute of their own.

The shortcut

Ask "Is it allowed, and useful, to keep the raw data in the target?" If yes → ELT, and keep the raw data. If the raw data must not land there, or cannot be processed there → transform first with ETL. Many platforms mix the two per source.

Choosing per PedalCity sourceStep 1 of 4
  1. rides

    Harmless raw data that SQL can handle. ELT: load to stg_rides, then transform in SQL.

Drills

Answer fast — trust the rule.

quick drill

In ELT, where does transformation happen?

quick drill

What is ELT's biggest advantage when a business rule changes?

quick drill

Payment records contain full card numbers that must never be stored in the warehouse. Which pattern fits?

quick drill

Which of these is a transform step?

Remember

  • ETL shapes before loading; ELT loads raw first, then shapes inside the warehouse.
  • Ask whether raw data may and can live in the target.
  • ELT keeps raw data for replays; ETL protects data that must not land raw.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainETL or ELT?

PedalCity adds a rider-support source whose tickets contain free-text messages that may include phone numbers. Decide between ETL and ELT for it and justify your choice, covering privacy and the ability to reprocess later.