Land it raw: the bronze layer
Stage 2: load. Whatever ingest fetched gets saved byte-for-byte before anyone cleans anything. That untouched copy is the bronze layer — the pipeline's memory. If a cleaning bug corrupts silver next month, bronze is how you rebuild without re-asking the source, which may no longer have the data.
The code
import json
from pathlib import Path
def land_raw(features, source, day):
# Partitioned path: one folder per source per day (Lesson 15)
folder = Path(f"lake/bronze/{source}/date={day}")
folder.mkdir(parents=True, exist_ok=True)
path = folder / "observations.json"
# Save the GeoJSON exactly as the API returned it — no edits
path.write_text(json.dumps({"type": "FeatureCollection",
"features": features}))
return path
In practice
Rule one: land, don't clean. Bronze is append-and-forget. The moment you fix a value during ingest, the original is gone, and with it your ability to prove what the source actually sent.
Rule two: partition by day. The date= folder layout from Lesson 15 means any single day can be reprocessed, rebuilt, or deleted without touching the rest of history.
Rule three: name the source. bronze/nws/…, bronze/noaa/… — two sources landing in the same lake never collide, and every silver row can be traced back to where it came from.
This is the medallion pattern: bronze (raw) → silver (validated) → gold (enriched, served). It is a convention, not a product — folders and discipline. Storage is cheap; re-fetching history is expensive or impossible, because APIs rotate data away and stations go offline. Bronze is what makes every later stage rerunnable, testable offline, and safe to change.
Python bridge: This is Lesson 15's partitioning plus Lesson 14's 'files are the lake'. The new idea is a discipline, not a tool: raw first, questions later.
Further reading
What is the medallion lakehouse architecture? — Databricks Docs (the official medallion explainer — what belongs in bronze, silver, and gold (the pattern itself is vendor-neutral))
Try it
Practice question: A teammate suggests saving disk by cleaning the JSON during ingest and skipping the raw copy entirely. Give two concrete things that break the first time the cleaning code has a bug.
Show answer
Result: First, there is no way back: the bug's damage is baked into the only copy of the data, so recovery means re-fetching — and the API may have rotated those days away for good. Second, there is no comparison: you cannot diff the cleaned output against what the source actually sent, so you cannot prove whether the bug is in your code or the source's data, or test a fix against the original input. Bronze is insurance that costs disk space and pays out at every incident.