learn-data-pipelines-with-phoebe / Session 3 of 6
Learn Data Pipelines with Phoebe · Session 3 of 6

The cleanup room: raw to ready inside the warehouse

At 2:15am, order #8412 landed on the shelf exactly as the app wrote it - next to its own duplicate, a QA tester's fake order, and a refund that lives in a different system entirely. Raw data is unusable on arrival, every time, everywhere. Today we walk into the room where that mess becomes the number executives trust: the raw copy that never gets touched, the layers that clean in stages, and the story of why the whole industry flipped the order of operations.

🟡 Building No code, no jargon Anyone who reads dashboards 45 min + self-study depth
0-3 · Welcome 3-22 · Concepts 22-40 · Spot the rules 40-45 · Q&A
Part 0

Why this session exists

Nobody ships coffee beans straight from the truck to a customer's cup. And nobody should ship raw data straight to a dashboard - it arrives full of duplicates, test orders, typos, and refunds living in another system. Yet the dashboard number looks clean, confident, and singular. The gap between those two states is the cleanup room, and it is where trust is manufactured. Understand this room and you will never again hear "the data needs cleaning first" as an excuse - you will hear it as the actual work.

Live - covered in session Self-study - read after ✦ Try it on your own dashboard ☕ The Daybreak case
★ What you walk out with today The raw-clean-ready layering that every serious data team uses (and the bronze/silver/gold names you may have overheard, decoded), the ETL-to-ELT story that explains why cheap storage changed how everyone works, and a plain-English decode of dbt. Plus five cleaning rules you will spot behind your own dashboard number.
Where we are on the map Source and ingest are behind us - the beans are on the shelf. Today is the store and transform boxes: what the shelf actually is (briefly), and what happens between "landed raw at 2:15am" and "cleaned at 4:30am" in order #8412's journey.
Part 1 · covers the storage box, briefly

The shelf, briefly 5 min live

Before we clean anything, thirty seconds on the room itself. A data warehouse is one big shelf everything lands on - a database built for reading and analyzing lots of history at once, not for running the app. The checkout database answers "process this one order, right now"; the warehouse answers "sum every order this year, by month". Same data, opposite jobs.

LiveWarehouse, lake, and where the depth lives5 min▶

One honest paragraph on a distinction you will overhear: a warehouse is a structured shelf - data arrives in tidy rows and columns, ready to be queried. A data lake is an everything-bucket - files of any shape (logs, images, exports) dumped cheaply now, organized later, if ever. Modern platforms increasingly blur the two, but the instinct holds: shelf means structure up front, bucket means structure deferred. For this course, Daybreak has a warehouse, and that is all we need.

And an honest pointer: this course walks past the warehouse building; it does not go inside. If you want the interior tour - how the shelf is organized, real SQL, why some questions run fast and others crawl - that is the sister course learn-data-warehouse-with-phoebe, built on the same Daybreak case. Same company, same order #8412, one floor deeper. We refuse to pretend five minutes covers what that course takes six sessions to teach.

Part 2 · covers the layering habit

Keep the raw copy, clean in layers 8 min live

The best habit in the building sounds wasteful the first time you hear it: keep an untouched raw copy of everything, forever. Then clean in stages - raw to clean to ready - so every number on the dashboard can be traced backward through the layers to the evidence. Here is order #8412 wearing all three outfits.

Raw - the "bronze" shelf #8412 · $42 · 11:41pm Sun #8412 · $42 · duplicate click #9001 · $0 · QA test order refund? lives in Stripe, not here exactly as the app wrote it untouched, kept forever Clean - the "silver" shelf #8412 · $42 · one row duplicate click collapsed test order removed refund joined from Stripe rules applied, same every night trustworthy, still detailed Ready - the "gold" shelf daily_revenue Sunday · $18,240 one row per day #8412 is $42 of that number shaped for the dashboard what the dashboard reads Same order, three outfits - raw keeps the evidence, clean earns the trust, ready answers fast.
🔍 Click to zoom - order #8412 on the raw, clean, and ready shelves
LiveWhy the untouched copy is the best habit in the building5 min▶

Three reasons teams keep raw data exactly as it arrived, typos and all:

  • Replay after bugs. Suppose a cleaning rule turns out wrong - it was deleting real orders it mistook for tests. With the raw layer intact, you fix the rule and re-run the cleanup over history; every past number heals. Without it, the mistake is permanent, because the evidence was edited.
  • An audit trail. "Prove where this figure came from" - an auditor, a payment partner, a skeptical board member. The raw layer is the receipt: here is what the source said, here are the written rules, here is the result.
  • It costs almost nothing. Cloud storage is cheap enough that keeping everything raw is a rounding error next to the cost of ever being unable to answer the first two points.

The layer names, decoded: you may hear bronze / silver / gold - that is Databricks' terminology for exactly this layering. Bronze is data as-is from the source, silver is cleansed and merged, gold is consumption-ready for dashboards and reports. Other teams say raw / staging / marts. The outfit names vary; the wardrobe is the same.

LayerAlso heard asOrder #8412 looks like
Rawbronze, landingtwo rows (the duplicate click intact), the QA test order sitting nearby
Cleansilver, stagingone trustworthy row, refund joined in from Stripe
Readygold, marts$42 inside daily_revenue: Sunday, $18,240, one row per day
Real worldDatabricks calls this the medallion architecture, and its published definition maps one-to-one onto today's diagram: bronze as-is, silver cleansed and merged, gold ready to consume. When someone says "that lives in silver", they are telling you which shelf - cleaned, but not yet shaped into final metrics.
Self-studyWhy not just clean it before storing it?3 min▶

A fair question sits under this whole design: if raw data is unusable, why shelve it at all? Why not clean it on the truck, before it ever lands? That is not a naive idea - it is how the entire industry worked for decades. Cleaning before storing saves shelf space, and when shelf space is the expensive thing, you save it.

So what changed? The price tag. That story - and how it quietly flipped the order of operations everywhere - is part 3, and it explains more overheard jargon per minute than anything else in this course.

Part 3 · covers the great flip

The ETL vs ELT story 7 min live

Two acronyms, one letter swapped, and behind the swap a genuine turning point in how companies handle data. ETL: extract, transform, load - clean the data before shelving it. ELT: extract, load, transform - shelve it raw first, clean it inside the warehouse. The letters moved because a price collapsed.

ETL - the old road: clean BEFORE the shelf 🛒Source 🧼Transform 🏬Warehouse storage was precious - clean first, shelve less, raw copy discarded ELT - the new road: shelve raw, clean INSIDE 🛒Source 🏬 Warehouse Raw 🧼Transform raw kept forever, mistakes replayable, cleanup rules are SQL anyone can review Storage fell from the ~$1M-per-GB era to cents - so the industry flipped the letters and kept the raw copy.
🔍 Click to zoom - the old ETL road and the new ELT road, compared
LiveThe price collapse that flipped an industry4 min▶

In the old world, storage was the expensive thing - so you cleaned data on the way in and shelved only the polished result. Sensible economics, with a hidden cost: no raw copy meant no replay, no audit trail, and cleaning logic buried inside specialized tools few people could read.

Then cloud storage collapsed in price - from roughly a million dollars per gigabyte in the early days to cents per gigabyte today. When the shelf becomes nearly free, the smart move inverts: shelve everything raw first, then clean inside the warehouse, where there is room to keep every layer. The consequences are exactly the habits from part 2:

  • The raw layer becomes affordable, so it becomes standard.
  • Mistakes become replayable - fix the rule, re-run history.
  • Cleaning rules move into the warehouse as SQL - written down where anyone on the team can read and review them, instead of locked inside a tool.
ETL - the old roadELT - the new road
Cleaning happensbefore the shelf, in a specialized toolinside the warehouse, written as SQL
Raw copydiscarded - the shelf was too expensivekept forever - the shelf costs cents
A wrong rule ispermanent - the evidence was editedreplayable - fix it, re-run history
Who can review rulestool specialistsanyone on the team who reads SQL
Real worldFivetran - a company whose whole business is the truck - tells this same story in its ETL-versus-ELT explainer: cheap cloud storage is what shifted the industry to ELT. When the people selling the pickup say "just load it raw, clean it after", the flip is complete.
Self-studydbt, decoded: the cleanup room's rulebook3 min▶

ELT created a new question: if cleaning now happens inside the warehouse, who keeps the cleaning rules organized? The answer you will overhear constantly is dbt. Decoded: dbt is the cleanup room's rulebook - a way to write every cleaning rule down, keep every version, and let anyone review a change before it takes effect. "Collapse duplicate clicks", "orders from QA accounts do not count", "join refunds from Stripe" - each rule written out, versioned, reviewable.

Hear the echo from session 1: the Friday spreadsheet died because the rules lived in one person's head. dbt is the industry's answer at pipeline scale - rules living in a shared, reviewable rulebook instead of in Sarah. It is not a database and it does not store data; it is the discipline layer for the transform box. Writing actual dbt models is code and stays with dbt's own free Fundamentals course - but you now know exactly what the name means in a meeting.

Everyone works

Spot the cleaning rules 🧼 ★ 18 min · everyone works

Notebook exercise. In session 1 you traced one of your own numbers back through the six stages. Today you interrogate its cleanup: for that number to be true, a set of cleaning rules MUST have run - and you can deduce most of them from your chair, without asking anyone.

Take your traced number from session 1's napkin - weekly sales, sign-ups, whatever you picked. Write it at the top of the page.

List five things that must have been cleaned for it to be true. Steal from Daybreak's list: duplicates collapsed, test orders removed, refunds subtracted, currencies converted, late-arriving orders assigned to the right day. Which five apply to yours?

Guess which layer each fix lives in. Raw is untouched by definition, so every fix is clean-layer or ready-layer. Rule of thumb: fixing individual rows (dedupe, remove tests) is clean; shaping and summing into the final metric (one row per day) is ready.

Write ONE rule as a plain sentence. Daybreak's example: "orders from @daybreak.com emails are test orders and do not count." No code - if you can say the sentence, someone can write the rule.

Find the sentence's soft spot. Every rule has an edge case: what about an employee who genuinely buys a gift bundle with their work email? Note one way your rule could quietly miscount - you have just done a data-quality review.

Mark what would break silently. If one of your five fixes stopped running tomorrow, would anyone notice, or would the dashboard just smile with a slightly wrong number? Circle the silent ones - session 5 is about exactly those.

✦ If you finish early Write a second rule sentence for the trickiest item on your list - usually refunds ("subtracted from the day of the refund, or the day of the original order?"). Notice that answering it is a business decision, not a technical one. That thought is session 4's opening act.
Before next session

Homework 📝 ◐ 20 minutes

Check yourself

Three questions before you go 🎯 ◐ 90 seconds

1 · The main reason teams keep an untouched raw copy of all incoming data is...

Raw is not more accurate - it is full of duplicates and test orders. Its value is being the evidence: fix a wrong rule and re-run history over the raw layer, and show auditors exactly what the source said. Cheap storage made this habit affordable.

2 · What flipped the industry from ETL (clean before shelving) to ELT (shelve raw, clean inside)?

ETL made sense when the shelf was the expensive thing. Once storage cost cents per gigabyte, shelving everything raw first became affordable - and bought replayability, audit trails, and cleaning rules written as reviewable SQL. Economics moved the letter.

3 · dbt is best described as...

dbt stores no data and displays nothing. It organizes the transform box: every cleaning rule written out, every version kept, every change reviewable - the industry's answer to rules living in one person's head, which is exactly how session 1's spreadsheet era died.

Coverage, honestly

What this session covered from the official universe

✓Databricks medallion architecturebronze / silver / gold decoded as raw / clean / ready - their terminology, credited
✓Fivetran - ETL vs ELTthe storage price collapse and the industry flip, taught as the part 3 story
◐dbt Fundamentalsthe concept decoded in plain English - writing actual models stays with dbt's free course
◐DeepLearning.AI Data Engineering - courses 3-4storage and transformation introduced in plain English; the technical depth stays with DLAI

Certificates, videos, and graded assessments stay with the official providers - this course teaches the working core in plain English.

Session 3 cheat sheet

Raw arrives unusableDuplicates, test orders, typos, refunds in another system - every time, everywhere. The cleanup room is where trust is manufactured.
Warehouse vs lakeWarehouse = structured shelf, queried in rows and columns. Lake = everything-bucket, structure deferred. Daybreak has a shelf.
The best habitKeep an untouched raw copy forever: replay after bugs, audit trail on demand, and cheap storage makes it a rounding error.
Raw → clean → readyRaw as the app wrote it; clean with rules applied (dedupe, de-test, join refunds); ready shaped for the dashboard - daily_revenue, one row per day.
Bronze / silver / goldDatabricks' names for exactly this layering: bronze as-is, silver cleansed and merged, gold consumption-ready. Dialect, not doctrine.
ETL → ELTOld road: clean before shelving, because storage was precious. New road: shelve raw first, clean inside - because storage fell to cents per GB.
dbt, decodedThe cleanup room's rulebook: cleaning rules written down, versioned, reviewable - instead of living in someone's head. Not a database.
A rule is a sentence"Orders from @daybreak.com emails are test orders and do not count." If you can say it, someone can build it - and someone should review it.