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
SELECTstatement; 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.