Skip to content

dbt — Semantic Layer & Transformations

Overview

AKKO uses dbt Core (Apache 2.0) with the dbt-trino adapter as its semantic layer and SQL transformation engine.

dbt defines business metrics and transformations in version-controlled SQL files. It replaces Cube.dev (which uses ELv2, a non-OSI license) so every AKKO dependency stays Apache-2.0 / MIT / BSD — see rule R27 in the engineering handbook.

Architecture

PostgreSQL (banking tables)
    ↓ JDBC
Trino (federation engine)
    ↓ dbt-trino adapter
dbt Core (SQL transformations)
    ↓ writes to
Iceberg/object storage (analytics marts)
    ↓ consumed by
Superset / Notebooks / APIs

Models

Staging (source cleaning)

Model Source Description
stg_customers postgresql.banking.customers Clean customer data
stg_accounts postgresql.banking.accounts Clean account data
stg_transactions postgresql.banking.transactions Clean transaction data

Marts (business logic)

Model Description
mart_customer_360 Customer 360 view with account + transaction aggregates
mart_daily_transactions Daily transaction volume by category
mart_fraud_summary Per-customer fraud risk indicators

Configuration

dbt connects to Trino via environment variables (zero hardcoding):

Variable Default Description
TRINO_HOST akko-trino Trino coordinator hostname
TRINO_PORT 8080 Trino port
TRINO_USER dbt-akko Trino user for dbt

Usage

# Run all models
kubectl run dbt-run --rm -i --restart=Never -n akko \
  --image=akko-dbt:2026.03 \
  -- dbt run --profiles-dir /dbt --project-dir /dbt/project

# Run tests
kubectl run dbt-test --rm -i --restart=Never -n akko \
  --image=akko-dbt:2026.03 \
  -- dbt test --profiles-dir /dbt --project-dir /dbt/project

Adding Models

  1. Create SQL file in docker/dbt/project/models/
  2. Add schema tests in schema.yml
  3. Rebuild image: docker build -t akko-dbt:2026.03 docker/dbt/
  4. Run: dbt run

License

dbt Core: Apache 2.0. dbt-trino: Apache 2.0.