Follow these practices for maintainable dbt projects.
Naming:
- Staging models:
stg_<source>__<table> - Intermediate:
int_<concept> - Final marts:
<entity>_<verb>(e.g.,orders_monthly)
Structure:
- One model per file
- Define sources in
_sources.yml - Test every model
- Document columns
Performance:
- Use incremental for tables > M rows
- Limit staging to column selection and renaming
- Push complex logic to intermediate layer