05 · ANALYTICS ENGINEERING
Adventure Works data pipeline with dbt and BigQuery
Analytics engineering certification project built on dbt Core and BigQuery. Adventure Works SAP data flows through three disciplined layers — staging standardises raw inputs, intermediate applies business logic, and marts deliver domain-organised dimensional models ready for BI consumption. Every layer covered by automated dbt tests and generated documentation.
- TYPE
- Analytics engineering
- SOURCES
- 64 SAP tables
- WAREHOUSE
- BigQuery
- LAYERS
- 3 · stg → int → mart
01 — CONTEXT & APPROACH
From raw SAP exports to a dimensional schema — the analytics engineer’s job.
The source data problem
SAP systems generate tables optimised for transactional throughput, not analytical querying. Column names are abbreviated, types are inconsistent across modules, null handling is implicit, and relationships are buried in surrogate key conventions that vary by SAP module. Adventure Works exposes all of this across 64 tables spanning six business domains.
The analytics engineer’s job is to impose order without losing fidelity: standardise the grain, enforce types, name things for humans, and model the business logic once — so every downstream consumer sees a consistent, documented, testable surface.
Why the three-layer architecture
Separation of concerns. Staging is never business logic — it is just standardisation. Intermediate is never a BI model — it is preparation. Marts are the contract: the stable, domain-facing surface that BI tools and analysts depend on.
When a source changes schema, only the staging model needs to change. When business logic changes, only the intermediate model changes. The mart stays stable — and with it, the dashboards that depend on it.
02 — THREE-LAYER ARCHITECTURE
Staging cleans. Intermediate joins. Marts deliver.
The three-layer pattern imposes strict separation of concerns. No staging model contains business logic. No mart model reads directly from source. Each layer has a single responsibility — and a test suite to prove it.
03 — BIGQUERY DATASET STRUCTURE
One BigQuery project, four datasets — each owned by a dbt layer.
dbt manages the physical dataset structure in BigQuery. Each layer materialises into its own dataset, giving analysts a clear contract: query mart tables, never staging or intermediate tables directly. The layer boundary is both a modelling convention and an access-control point.
04 — DIMENSIONAL MODEL
A classic star schema — one fact, five dimensions.
The mart layer delivers a dimensional model centred on the sales fact — the most analytically valuable grain in the Adventure Works dataset. Every dimension is directly joinable via surrogate key, following Kimball’s dimensional modelling principles.
05 — TEST COVERAGE & DOCUMENTATION
Every model tested. Every column documented. No exceptions.
dbt’s built-in test framework is applied at every layer. Tests are not optional bolt-ons — they are the mechanism by which the pipeline proves to downstream consumers that the data meets its documented contract.
06 — DELIVERABLES
Everything a BI consumer and an engineering reviewer would expect to find.
The project is open-source and documented to certification standard. Every deliverable below is present in the repository and can be verified without running the pipeline locally.
- 01dbt project (staging → intermediate → marts)64 staging models covering all SAP source tables, multiple intermediate transformations, and a full star-schema mart layer covering Sales, Products, HR, and Territory domains.
- 02Automated test suitenot_null, unique, accepted_values, and relationships tests at every layer. Tests block downstream materialisation on failure — a broken mart cannot be produced from untested source data.
- 03dbt documentation siteGenerated via dbt docs generate — all models, columns, tests, and source-to-mart lineage graphs browsable without running the project locally.
- 04Conceptual data modelEntity-relationship diagram documenting the mart layer star schema — published externally for stakeholder review and onboarding.
- 05BI dashboardDashboard built directly on the mart layer, demonstrating that the dimensional models are BI-tool-ready without further transformation.
- 06profiles.yml + packages.jsonFully configured BigQuery connection profile and package manifest — the project is reproducible from a fresh clone with BigQuery credentials.
Analytics engineering is not about writing SQL — it is about building a reliable contract between raw data and the people who depend on it. Three layers. Automated tests. Generated documentation. No shortcuts.