Build a
Kimball
data warehouse with dbt + Postgres
FreshCart's data is normalized for transactions, not analysis. Architect 22 dbt models — 4 conformed dimensions, atomic + event facts, SCD Type 2 history, incremental processing, and a Slim CI gate — against a 600K-order Postgres source.
Dimensional modeling is still the most-asked analytics interview topic — this gives you a complete warehouse you can walk through, end-to-end.
- A 22-model dbt project running locally against Postgres
- Four conformed dimensions plus SCD Type 2 history for customers
- Atomic-grain order facts, two event facts, and a bridge table
- Incremental events — measured 4 min → 30 sec speedup
- A GitHub Actions Slim CI workflow gating every PR
- dbt docs lineage and exposures.yml for downstream BI
SELECT, JOIN, window functions) and basic command-line. dbt familiarity helps but isn’t required — the project teaches it as you build.Every module is fully unlocked on the free plan.
Free-tier project — full path from a 600K-order Postgres source to a Slim-CI-gated Kimball warehouse with 22 models. No paywall, no card required.
Advanced Data Modeling & Architecture
This curriculum walks the same Kimball + advanced-modeling ground at a deeper level — recommended companion reading while you build.
Three sprints. Three checkpoints. One shippable warehouse.
Each phase ends with a green dbt build and a tagged commit you can point to. No ambiguity about where you are.
Schema designed, dimensions built, atomic facts shipped. SCD Type 2 history captured for customers via dbt snapshots.
- ✓4 conformed dims (customers, products, stores, dates)
- ✓fct_orders + fct_order_items at atomic grain
- ✓customers_snapshot.sql + dim_customers_scd2
Event facts, incremental processing, bridge table for many-to-many, and a dbt-native metrics layer.
- ✓fct_page_views + fct_cart_events (incremental)
- ✓bridge_customer_products
- ✓3 metrics YAML files (revenue / customer / derived)
Test pyramid green. Slim CI gating every PR. dbt docs + exposures auto-publish.
- ✓200+ test assertions across 22 models
- ✓.github/workflows/dbt_ci.yml (Slim CI)
- ✓dbt docs lineage + exposures.yml
One command. Local Postgres, dbt, and 6 seed CSVs.
Download the starter kit — a 31 KB scaffold with 6 seed CSVs (~1.1k rows), all model stubs, snapshot config, and a profiles template. Ready to run in under 5 minutes.
What lives in the starter kit
Everything you need to start writing real Kimball models against real-shaped data on day one — no warehouse signup, no cloud credentials.
- seeds/ — customers, products, stores, orders, order_items, web_events (6 CSVs)
- models/ — staging, marts, snapshots scaffolded
- snapshots/ — customers_snapshot.sql ready for SCD2
- macros/ + packages.yml — dbt_utils + dbt-expectations + custom test scaffolds
- profiles.yml.example — Postgres-first profile, Snowflake notes inline
FreshCart Warehouse Starter
Pre-configured scaffolds, sample CSVs, and dbt project files. Skip the boilerplate, start on module 01.
Three things you can put on your résumé.
Kimball dimensional modeling
4-step methodology, conformed dimensions, atomic vs aggregate grain, surrogate keys, and SCD Type 1 vs Type 2 — the same patterns analytics teams ship in production.
Production dbt patterns
dbt snapshots for change data capture, incremental models with is_incremental(), schema tests, custom generic test macros, singular tests, and source freshness checks.
Analytics engineering CI
GitHub Actions Slim CI with state:modified+ + --defer, dbt docs auto-generated lineage, and exposures.yml linking models to downstream BI consumers.
The same warehouse — but built like someone depends on it.
Most dbt tutorials stop at dbt run green on your laptop. This one ships you the patterns that change when finance opens the dashboard at 9am.
is_incremental() with state:modified+ --deferdbt snapshot with valid_from / valid_to + SCD2 join macroseverity: error on FK + uniqueness, blocks downstreamsources.yml freshness: SLA + warn/error thresholdsdbt build --select state:modified+dbt docs generate + exposures.yml auto-publishPick this if you’re shipping analytics, not learning to.
Analytics engineers
You write SQL all day but want the production patterns: SCD2, incremental, contracts, Slim CI, and exposures.
Data analysts leveling up
You're tired of one-off queries. You want to own the model behind the dashboard, not just the chart on top of it.
Backend engineers crossing over
You know systems but the warehouse is opaque. This makes dbt feel like the codebase you already know — refs, tests, CI gates.
Finance / ops crossing into data
You live in spreadsheets. You want one source of truth that doesn't break when somebody renames a column at 5pm.
Going deeper? Three tracks back this project.
Advanced data modeling is the spine — the two paths next to it let you sharpen the SQL underneath the schema and the observability layer that protects it.
Quick answers.
Ready to ship a real dbt warehouse?
Module 01 takes about 4 hours. By the end you'll have Postgres + dbt running locally with your first 4 dimensions modeled and tested.