dbt platform engineering methodology — project structure, SQL style, naming conventions, testing coverage, materializations, governance, CI/CD, performance tuning, refactoring, and anti-patterns. Load when building dbt models, reviewing dbt PRs, creating dbt tests, choosing materializations, writing dbt SQL, organizing dbt YAML, or evolving dbt projects.
Opinionated methodology for building and maintaining dbt projects. Synthesized from dbt Labs guides, Coalesce 2024-2025, and community production experience.
models/
staging/<source>/ stg_<source>__<entity> view
intermediate/ int_<logic>__<entity> ephemeral|view
marts/<domain>/ fct_<event> / dim_<entity> table
Rules:
source() only in staging. ref() everywhere else. Never hardcode table names.| File | Location | Convention |
|---|---|---|
| Model SQL | models/<layer>/<domain>/ | One concern per file. Max ~300 lines. |
| Schema YAML | Same directory as models | _<domain>__models.yml (underscore prefix) |
| Source YAML | models/staging/<source>/ | _<source>__sources.yml |
| Tests (singular) | tests/ | <assertion_name>.sql |
| Macros | macros/ | Namespaced: grant__, audit__, dq__ |
| Seeds | seeds/ | Lookup tables only. Max 10K rows / 10MB. |