
Better Data Engineering Part 2: Modeling with dbt
A guide to staging, modeling layers, and building clean transformation flows with dbt.
Why?
Because most data warehouses fail not from ingestion…
…but from bad modeling.
Introduction
dbt encourages a layered approach that keeps your warehouse:
- clean
- predictable
- maintainable
Let’s break down the essential layers.
Rule 1: Start with Staging
Staging models:
- clean raw data
- standardize naming
- cast types
- flatten structures
Think of staging as your contract with the raw world.
Rule 2: Build Intermediate Models
These models:
- join datasets
- apply business logic
- prepare data for marts
They keep your marts clean and focused.
Rule 3: Deliver Dimensional Marts
Your marts should be:
- business-friendly
- stable
- well-documented
- optimized for BI
Use:
- fact tables for events
- dimension tables for entities
Rule 4: Keep Logic Out of Dashboards
Dashboards should visualize data, not compute it.
dbt centralizes logic so every team uses the same definitions.
Part 3 coming soon!
