Skip to content
The cover of Data build tool (dbt) Cookbook by Kapil Dev V

Data build tool (dbt) Cookbook

Build a Medallion Warehouse with dbt Core 1.x

by Kapil Dev V · dbt engineering, book 1 of 2

One project, built end to end: an Indian e-commerce warehouse taken from raw landing through bronze, silver and gold to tested, documented marts, with every file explained. Every command and its output was run against dbt Core 1.12.0 on DuckDB, so you can reproduce all of it on a laptop, with no cloud account of any kind.

The Kindle eBook. Amazon.in in India, Amazon.com outside India.

What you will be able to do

  • Lay out a dbt project and say what every file and folder is for
  • Declare sources, monitor freshness, and read a stale result correctly
  • Choose view, table, ephemeral or incremental per model, on purpose
  • Map bronze, silver and gold onto folders, schemas and enforceable rules
  • Build fact and dimension models whose grain is decided before the SQL
  • Read any Jinja in a project, and write macros that are worth having
  • Write generic, custom generic and singular tests, and skip the ones that check twice
  • Capture history with snapshots and query it with valid-from and valid-to
  • Work in VS Code with Power User for dbt, and take a change from a branch to a merged pull request
  • Generate documentation and ship the project on a schedule

For anyone who writes good SQL and has a folder of it: scripts run by hand or by a scheduler, with no tests and no lineage.