dbt Incremental Models in Production: unique_key, Merge, and Late Arrivals
How incremental dbt models actually write: unique_key as merge grain, is_incremental filters, lookback windows, and the late-arrival cases that silently drop rows.
- dbt
- sql
Topic
9 posts ·view all posts
How incremental dbt models actually write: unique_key as merge grain, is_incremental filters, lookback windows, and the late-arrival cases that silently drop rows.
A plan is a snapshot diff you apply. Virtual environments share unchanged physical tables. dbt defer is CI, not isolation. Do not migrate a healthy dbt estate. You still need an orchestrator.
Set up a dbt project from scratch: staging models, marts, tests, and documentation — with the project structure conventions used by real teams.
Cutting dbt run time and warehouse spend on a large project: how to find the real critical path, when threads stop helping, and how to attribute cost to individual models.
Which Jinja patterns are worth the indirection in a production dbt project, how to test macros, and the metaprogramming that quietly makes a project unmaintainable.
Choosing between check and timestamp snapshot strategies, what happens when a snapshot run is missed, and the cases where a hand-rolled SCD2 model beats dbt snapshot.
How I lay out staging, intermediate, and marts so a dbt project still makes sense after two years: naming rules, ref boundaries, and the folders that always rot.
How to get dbt CI from 50 minutes to 4 with state comparison and defer: manifest artifacts, GitHub Actions wiring, and the edge cases that bite.
How I structure dbt tests in production: generic tests on keys, unit tests on logic, dbt-expectations on shape, severity that means something.