PT

2025-11-04

How I structure dbt projects from staging to marts

Staging, intermediate, and marts, with KPI definitions in the semantic layer.

dbtBigQueryAnalytics engineering

I keep dbt projects in three layers so someone else can follow the graph. Staging stays close to the source: rename columns, set types, and do light cleaning. If two sources disagree, that should still be visible here.

Intermediate models hold joins and shared business logic. This is where I define things like a completed transaction, merchant attribution, or which rows count as revenue.

Marts are the tables people report from. They are narrower, documented, and tested against the questions Finance, Risk, or Operations actually ask.

LookML or another semantic layer sits above that and holds KPI names. Testing, documentation, and lineage make it possible to change a model later without guessing what it was for.