System Design · easy

What is the difference between a staging model and a mart in dbt, and why keep them separate?

Asked in Analytics Engineer interviews, in the System Design round.

Short answer

Staging is one-to-one with a source: rename, cast, and clean only, no business logic, no joins. Marts are the joined, business-shaped tables analysts query. Separating them means a source change is absorbed in one place, logic is reusable across marts, and each layer's contract can be tested on its own.

StagingMart
GrainOne model per source tableOne model per business entity
JoinsNoneYes, that is the point
Business logicNoneYes
DoesRename, cast, clean, deduplicateCombine, aggregate, apply definitions
Namedstg_charges, stg_usersdim_customer, fct_orders
Changes whenThe source changesThe business definition changes
Why separateA renamed source column is fixed in one placeAnalysts read one clean layer, never raw
One staging model per source, so a renamed column is fixed once.

How to answer it

Definition

Staging models clean one source table each. Marts join them into the entities the business asks about. The table above compares them; what follows is why the separation earns its keep.

The layers

sources     raw, loaded by the pipeline, never edited

staging     one model per source table
            rename, cast, clean, deduplicate
            no joins, no business logic
            stg_stripe__charges, stg_app__users

intermediate (optional)
            reusable joins that are not themselves a business entity

marts       the entities people ask for, joined and tested
            dim_customer, fct_orders

Why separate them

The cost, honestly

More models and more files, and a staging model that only renames columns feels like ceremony on a small project. With three sources and one dashboard it probably is. The separation pays off with many sources and many consumers, which is where dbt projects usually end up.

Key points

FAQ

The 30-second answer

Staging is one model per source table doing only mechanical work: renaming, casting, light cleaning, no joins and no business logic. Marts are the entities the business actually asks about, where the joins and the definitions live and where the meaningful tests sit.
The reason to keep them separate is that a renamed source column then gets fixed in one staging model instead of in every mart that happened to touch it. It also gives downstream models a stable vocabulary, so a source migration stops at the staging layer and nothing else notices.
I would be honest that on a small project with three sources it can feel like ceremony. The payoff arrives with many sources and many consumers, which is where most dbt projects end up.

In the interview

Practice this for real