| name | dbt-best-practices |
| description | dbt data modeling best practices following Kimball/dimensional modeling. Use when writing or reviewing dbt models, adding tests, choosing materializations, or following SQL/YAML/Jinja style conventions. Covers architecture layers, naming conventions, testing strategy, SQL style, and BigQuery optimization. |
dbt Best Practices
Approach: Kimball / dimensional modeling (star schema).
Creating New Models
Step 1: Decide what to build
Read Architecture to determine:
- Which models to create (layer, prefix, naming convention)
- What each model queries (flow rules)
- Where to place files (folder structure)
Step 2: Write the .sql and .yml files
Read these three references, then create the files:
- General Rules — key rules, BigQuery optimization, testing by column pattern, severity, useful packages
- Naming & Style — column naming conventions, SQL/YAML/Jinja style
- The corresponding layer file:
Editing Existing Models
Identify the layer from the model's prefix, then read:
- General Rules
- Naming & Style
- The corresponding layer file (see table above)