internalsGet Pro

Data Engineering · Module 15

Transformations with dbt

Lessons
12
Free
1
Reading
~3 h

Your progress

0 / 12 lessons done

Sign in to track

Lessons

  1. dbt: transformations as version-controlled codeFreeMost data teams that load raw data into a warehouse build their reporting tables with SQL. dbt is the common way to keep that SQL in git, run it in the right order and test it before anyone reads the numbers.13 min
  2. dbt models, sources and referencesEvery dbt project is a graph that dbt draws from ref() and source() calls. Get the calls right and dbt builds in the right order, in the right schema; skip one and a model can quietly read yesterday’s data.14 min
  3. Materializations: views, tables and incremental modelsThe same SELECT can cost seconds or an hour a night, and a dashboard can open in a second or in minutes, depending on one config line. Choosing it per model is most of what keeps a dbt build inside its window.18 min
  4. Testing data with dbtA dbt project is only as trustworthy as the tests that run between its models. Choosing what to test, where in the graph, and how loudly a failure should stop the night decides whether a wrong number reaches finance or a harmless oddity wakes someone at 03:00.18 min
  5. dbt contracts, versions and microbatch modelsOnce other teams read your models, a column rename is an outage for them, and a billion-row event table can’t be rebuilt every time a night goes wrong. Contracts, versions and microbatch models are dbt’s tools for both.18 min
  6. Documentation and lineage in dbtEvery model you change has readers you didn’t write. Documentation and lineage are how you find them before a rename breaks a finance report or a forecast, not after.14 min
  7. Incremental models and late-arriving dataAn incremental model trusts its filter. If the filter skips a late row, no test fails and no error appears; the number is wrong, every night, until someone rebuilds the table.17 min
  8. dbt snapshots for slowly changing dataEvery other dbt model can be rebuilt from its inputs, but the source only holds today’s values. A snapshot is the one table that remembers, so a wrong setting writes wrong history that no rerun can repair.17 min
  9. Macros and packages in dbtEvery dbt project of any size repeats a few business rules across many models. Macros keep those rules identical everywhere, and packages let a team reuse tested ones, but both can also hide SQL from the people who review it.17 min
  10. Structuring a dbt project and running it in CIOnce more than one person changes a dbt project, every pull request needs a build you can trust before merge. Done badly, that build takes an hour or writes over production; done well, it takes minutes and touches nothing shared.17 min
  11. Case: Monzo’s 12,000 dbt models across 100 teamsOnce more than one team writes dbt models, a change in one team’s model can break another’s, and every team’s habits add to the warehouse bill. Monzo’s account shows one way to keep many teams in charge of their own models without letting the project drift.16 min
  12. Design: a dbt project for sales reportingMost analytics teams end up with one dbt project that feeds the reports the business runs on. Each feature can be set up correctly and the report still be late or wrong, so the project has to be designed as a whole, backwards from the people who read it.28 min

Practise with

No tools or paper guides for this module yet.

Terms this module teaches 54

Open glossary

Adapter dispatch

A dbt mechanism that picks a macro's implementation by the warehouse in use, looking for a version prefixed with the adapter's name, then one prefixed default__.