- https://handsondata.substack.com/p/how-to-structure-your-data-transformations
- Type: article
- Source: Hands-On Data (Tim Hiebenthal) · Substack
TL;DR
Warehouse layering (Bronze/Silver/Gold) says nothing about how to organise the transformations inside a layer, so the post proposes four narrower ones — Clean, Prep, Core, Mart — where each layer may only read the previous one and skipping one is a maintenance debt.
Summary
Medallion and the classic Source → Staging → Modeling → Presentation split solve where raw data lands, not how the transformation code should be organised; a single Gold layer holding 100+ models becomes unmaintainable. The fix is a four-layer contract. Clean standardises one raw table into one typed, renamed, NULL-corrected table, with no joins and no business logic. Prep is where application logic turns into business logic: joins, deduplication, mapping cryptic operational values. Core holds the single source of truth at atomic grain, one table per asset, and explicitly forbids chaining. Mart serves pre-aggregations, consolidations (actuals vs plan) and denormalised wide tables for the BI tool. The rule that enforces it: each layer reads only from the layer below — except Clean — and no layer is skipped.
Key takeaways
- Apply one cleaned table per raw table —
clean_<source_system>_<table>— so two consumers of the same source cannot diverge. - Keep joins and business logic out of Clean: parsing, types and naming only, or every downstream model inherits the mess.
- Let Core be the SSOT at atomic grain and push chained logic down into Prep instead of daisy-chaining core models.
- Do the denormalisation and pre-aggregation in Mart, not in the BI tool: it moves logic left into version control and out of the dashboard.
- Resist skipping a layer — the short cut is paid back later, in debugging, not in saved effort.
Tools and concepts
| Item | Role in the page |
|---|---|
| DBT | Its staging/intermediate/marts layout is the closest existing analogue; the post’s Clean maps to dbt staging |
| Data Engineering | Discipline the layering belongs to |
| SQL | Language the layers are expressed in |
| Medallion Architecture | Databricks’ Bronze/Silver/Gold naming that the article treats as complementary, not sufficient |
| Data Platforms | Where these layers physically live |
When to use
- When a warehouse has grown past a handful of models and nobody can say where a metric is computed.
- When deciding where a join or a deduplication step belongs in a dbt project.
- When a BI tool wants wide tables and you must pick the layer that denormalises.
Caveats
- One practitioner’s opinion with no benchmarks; the author concedes the four-layer idea is neither new nor unique.
- Assumes a SQL warehouse and dbt-like tooling; streaming or lakehouse-only setups are out of scope.
Related: Data Engineering DBT SQL Data Platforms BigQuery