Skip to content

Analytics Engineering and dbt

How analytics engineering brings software practices to SQL transformations, and how dbt models, tests and documents data.

Editorial team 2 min read

Analytics engineering sits between data engineering and analysis: turning raw data into clean, tested, documented models that analysts and BI tools use.

The Role

Analytics engineers write transformations (mostly SQL), design data models, define metrics and apply software engineering practices — version control, code review, testing and CI — to analytics code.

What dbt Does

dbt (data build tool) is a widely used framework for in-warehouse transformation.

  • Models: each model is a SQL SELECT statement; dbt builds it as a table or view.
  • Dependencies: models reference each other with ref(), so dbt knows the build order and lineage.
  • Tests: declare checks such as unique, not null, accepted values and relationships.
  • Documentation: descriptions for models and columns, and a generated documentation site with lineage graphs.
  • Materialisations: views, tables, incremental models and snapshots for history.

Example

-- models/orders_daily.sql
select date_trunc('day', ordered_at) as order_day,
       count(*) as orders,
       sum(total) as revenue
from {{ ref('stg_orders') }}
group by 1

Typical Layers

  • Staging: light cleaning and renaming of each source.
  • Intermediate: joins and business logic.
  • Marts: final models for specific uses — finance, marketing, product.

Benefits

Transparent, reviewable logic; consistent definitions; tests that catch errors before dashboards do; and faster onboarding thanks to documentation.

Good Practice

Keep models small and single-purpose, test primary keys and relationships, document as you go and use incremental models for large tables.

More in Data engineering

All Data engineering guides →
Data engineering Guide · 2 min

What Is Data Engineering?

What data engineers do, how data flows from source systems to analysis and AI, and the core skills involved.

Data engineering 2 min read 4 Jan 2026

Data engineering Guide · 2 min

ETL Versus ELT

The difference between transforming data before loading and after, and why modern warehouses shifted the default to ELT.

Data engineering 2 min read 3 Jan 2026

Data engineering Guide · 1 min

Data Warehouses, Data Lakes and Lakehouses

The three main architectures for analytical data storage, what each is good for and how they are converging.

Data engineering 1 min read 2 Jan 2026

Data engineering Guide · 2 min

Data Modelling for Analytics

Star schemas, facts and dimensions: how to design tables that make analysis fast, consistent and easy to understand.

Data engineering 2 min read 1 Jan 2026