Westport Horizon LLC
Technical deep dive

Simple Data
Environment

How the platform works end to end: where every byte lives, how data moves and changes from source to report, how we run and maintain it, how developers connect to each part, and how to extend it safely.

Data engineersAnalytics engineersBI developersPlatform and securityData governance
1
Ingest · dlt3 sources → raw Iceberg tables in sde_bronze
2
Land · S3 + Iceberg + GlueOne bucket in eu-west-1, one catalog
3
Transform · dbt-athenaIncremental MERGE to silver, star schema to gold
4
Serve · Power BI ImportODBC, gold only, read-only identity
3
sources: 1 mock, 2 public APIs
21
tables: 7 bronze, 8 silver, 6 gold
50
dbt data tests on every build
5
identities, least privilege each
0
stored secrets in CI (OIDC)
≈ $1–2
AWS cost per month
Westport Horizon LLC|Simple Data Environment · technical overview
Agenda

Four parts, twenty-four slides

Data residency and governance appear throughout. Each lineage slide names the physical location of the data at that step, and Part 3 covers the controls in one place.

Part 1
Architecture and residency
  1. Goals and the three planes
  2. Architecture
  3. Where the data lives
  4. Data residency register
  5. Lake layout: S3, Iceberg, Glue
Part 2
Data flows and lineage
  1. Sources
  2. Ingestion with dlt
  3. Bronze to silver
  4. Silver models
  5. Gold star schema
  6. Table lineage
  7. Column lineage: fct_sales
  8. Point-in-time correctness
  9. Power BI consumption
Part 3
Run, test, govern
  1. The daily run
  2. Code changes and CI
  3. Data quality controls
  4. Access matrix
  5. Personal data path
  6. Retention, deletion, audit
  7. Governance status
Part 4
Where it goes next
  1. Roadmap and summary
Westport Horizon LLC|Simple Data Environment · technical overview
Part 1 · Architecture

Design goals and the three planes

Six moving parts, one storage layer, no servers. The only bill is AWS. Everything else is open source or free.

Goal or constraintHow it is met
Modern but simpledlt, S3 + Iceberg, Glue, Athena, dbt, Power BI. GitHub Actions schedules them
Real and mock dataTwo free public APIs plus a deterministic retail generator
Open table formatEvery layer is Apache Iceberg (Parquet, zstd) on S3
Medallion in dbtBronze (raw) → silver (clean) → gold (star schema)
BI as the front endPower BI Desktop imports gold through Athena ODBC
Only AWS costs money≈ $1–2 per month at demo scale; GitHub within its free quotas
Data plane
Sources → bronze → silver → gold → Power BI

Stored once in S3, catalogued once in Glue, queried only through Athena. No copy of the data exists outside the bucket except the Power BI import and short-lived query results.

Control plane
Terraform defines, GitHub Actions runs

Every AWS resource is in infra/terraform. Three workflows schedule, test and publish. There is no orchestrator to host.

Access plane
One identity per job

An OIDC role for automation, and IAM users for BI (gold only), analysts (read all, write sandbox) and data admin. Each identity queries through its own guarded workgroup.

Westport Horizon LLC|Simple Data Environment · technical overview
Part 1 · Architecture

The data path and the tools that drive it

Left to right is the data plane. The bands below show which tool moves the data at each hop, and which identity it runs as.

Sources
Mock · FX · weather

Generator in ingestion/mock, Frankfurter (ECB rates), Open-Meteo archive.

HTTPS / in-process
›
Bronze
sde_bronze · raw

7 append-only Iceberg tables. Every row carries _dlt_load_id.

dlt → Athena destination
›
Silver
sde_silver · clean

8 models. Typed, deduplicated, merged incrementally. Customer and product history.

dbt-athena MERGE
›
Gold
sde_gold · star schema

2 facts, 4 dimensions, rebuilt in full each run. SCD2 customers.

dbt-athena CTAS
›
Power BI
SalesDemo.pbip

Import mode. 6 tables, 6 relationships, 89 measures, 2 pages, 5 tooltips.

Athena ODBC 2.x
Storage and compute
S3 · Glue · Athena v3

One lake bucket, one Glue catalog, one Athena workgroup per identity, each with a 1 GB scan cap and its own enforced result prefix.

Orchestration
GitHub Actions

pipeline daily at 05:30 UTC, ci on push and PR, docs after each pipeline. Auth to AWS by OIDC.

Infrastructure
Terraform

Bootstrap stack (state bucket, local state) and main stack (bucket, Glue, Athena, IAM, budget) with an S3 backend.

Developer desktop
uv · dbt · DBeaver · PBI

Same code runs locally and in CI. DBeaver over JDBC for ad-hoc SQL. Power BI Desktop for the model and report.

Westport Horizon LLC|Simple Data Environment · technical overview
Part 1 · Data residency

Where the data lives: four zones

Durable copies of row-level data exist only in the S3 lake bucket in eu-west-1 (Ireland) and in the Power BI import on a workstation. Everything else is transient or metadata only.

EXTERNAL GITHUB (HOSTED) AWS ACCOUNT · EU-WEST-1 (IRELAND) WORKSTATION FrankfurterECB FX rates, public Open-MeteoERA5 weather, public We send: date ranges, currency codes, and the lat/lon of 36 store cities. No customer data leaves. Runner (CodeBuild, eu-west-1) • mock generator, in memory • dlt load packages on local disk • dbt target/ and logs • AWS session creds (≤ 1 h) Wiped when the job ends Actions artifacts · 14 days run_results, manifest, dbt logs dbt docs artifact · 14 days dbt docs: SQL and columns, no rows Private repo: code and config only. .pbix, cache.abf, .env git-ignored. S3 lake bucket SSE-S3 · no public access sde_bronze_staging/7 d sde_bronze/retention rules sde_silver/retention rules sde_gold/rebuilt daily sde_sandbox/user-managed athena-results/7 d Glue catalog schemas, locations,Iceberg metadatapointers. No rows Athena v3 compute only,one workgroup per user,1 GB scan cap tfstate bucket resource config,versioned. No data,no secrets CloudTrail: 90 days ofAPI events, free tier Power BI Desktop full copy of the 6 goldtables in VertiPaq,saved to .pbi/cache.abf(git-ignored) DBeaver result grids in memory;exports if a user saves ~/.aws/credentials access keys per profile;.env holds bucket nameand settings only PUT ODBC
Westport Horizon LLC|Simple Data Environment · technical overview
Part 1 · Data residency

Data residency register

Every place where project data can exist, what form it takes, how long it stays and who can read it. Use this table when you answer a data-protection or audit question.

LocationZoneContentFormRetentionReadable by
Frankfurter, Open-MeteoExternalPublic reference data. They receive only dates, currency codes and city lat/lonJSON over HTTPSTheirsPublic
Runner diskeu-west-1Mock rows, dlt load packages, dbt target/Parquet, JSONUntil the job endsThe workflow only
sde_bronze_staging/S3dlt load files before the Iceberg insertParquet7 days (lifecycle)Pipeline role, data admin
sde_bronze/S3Raw rows, every load, plus _dlt_loads, _dlt_pipeline_stateIcebergCustomer data 3 y; erasablePipeline, data admin; analyst without PII columns
sde_silver/S3Clean, deduplicated rows and history versionsIcebergCustomer data 3 y; erasablePipeline, data admin; analyst without PII columns
sde_gold/S3Star schema for BIIcebergRebuilt each runAll four identities
sde_sandbox/S3Analyst tables, views, UNLOAD filesIceberg, Hive, CSVUntil the analyst drops itAnalyst, data admin
athena-results/S3Result set of every query, including Power BI imports; one prefix per workgroupCSV + metadata7 days (lifecycle)Own prefix only (data admin: all)
Glue Data CatalogAWSDatabase and table definitions, S3 locationsMetadataLifetime of the tablePer database, by IAM
ci_<run>_silver/goldS3 + GlueFull CI build from real bronzeIcebergDropped at the end of the runPipeline role
Power BI importWorkstationFull copy of the 6 gold tables, including customer columnsVertiPaq, cache.abfUntil deleted locallyWhoever has the file
Actions artifactsGitHubdbt run metadata and logs; dbt docsJSON, HTML14 daysRepo readers
Terraform stateS3Resource configuration. No data, no secretsJSON30 days of old versionsAdmins
Westport Horizon LLC|Simple Data Environment · technical overview
Part 1 · Storage

Lake layout: S3 prefixes, Iceberg files and the Glue catalog

Each S3 prefix matches a Glue database of the same name. Iceberg adds ACID commits, MERGE, schema evolution and time travel on plain Parquet files.

Physical layout of s3://sde-demo-lake-<account id>/

sde_bronze/orders/                    # dlt: {dataset}/{table}
    data/  *.parquet                  # row data, zstd
    metadata/ *.metadata.json, snap-*.avro, *-m0.avro
sde_bronze_staging/orders/…        # dlt load files, 7-day expiry
sde_silver/slv_orders/<uuid>/      # dbt: schema_table_unique
    data/order_date_month=2026-11/*.parquet
    metadata/…
sde_gold/fct_sales/<uuid>/…        # partitioned by month(order_date)
sde_sandbox/<table>/…             # analyst-owned
athena-results/sde-demo/ sde-demo-powerbi/ sde-demo-analyst/   # 7-day expiry

The dbt <uuid> suffix means a full rebuild writes to a new folder and swaps the Glue pointer, so readers never see a half-written table.

Bucket controls · storage.tf
  • Public access blocked on all four settings; object ownership BucketOwnerEnforced
  • SSE-S3 (AES-256) with bucket keys; Athena results also SSE-S3
  • Versioning off: Iceberg snapshots already give history and rollback
  • Lifecycle: athena-results/ and sde_bronze_staging/ expire after 7 days; incomplete multipart uploads abort after 1 day
Glue catalog
  • Databases sde_bronze, sde_bronze_staging, sde_silver, sde_gold, sde_sandbox, each with its S3 location
  • A Glue table points at the current Iceberg metadata.json; Athena follows it to manifests and data files
  • CI creates ci_<run id>_silver and _gold and drops them after the run
Westport Horizon LLC|Simple Data Environment · technical overview
Part 2 · Data flows

Three sources, three incremental strategies

Each source keeps its own high-water mark in dlt state, which lives in the bronze database. The state moves forward only when data really arrived.

Synthetic · deterministic
Mock retail generator

A coffee and bakery chain: 49 stores in 36 cities across 8 countries, about 1,200 orders and 2,300 lines a day, in local currency.

  • Randomness comes from a hash of (seed, entity, date, index), so any day regenerates identically
  • Quarterly re-pricing, customer profile changes, seasonality, a limited-edition product
  • State: last_generated_date; default end is yesterday
storesproductscustomersordersorder_lines
Real · public API
Frankfurter (ECB rates)

Daily reference rates, base EUR, for SEK, DKK, NOK, GBP, PLN and CHF. Business days only.

  • One range request /v1/{first}..{today} per run
  • The first run looks back 7 days so a weekend start still has a rate
  • State: last_rate_date; rows from before first are dropped
fx_rates
Real · public API
Open-Meteo archive

Daily min, max and mean temperature and precipitation from ERA5 reanalysis, about 5 days behind.

  • One call per city (36), copied to each store in that city
  • Days with null values are skipped and filled in by a later run
  • State: last_date_by_store; a new store backfills from SDE_START_DATE
weather_daily
Westport Horizon LLC|Simple Data Environment · technical overview
Part 2 · Ingestion

Ingestion with dlt: extract, normalize, stage, load

ingestion/pipelines/run.py runs one dlt pipeline per source (sde_mock, sde_fx, sde_weather), all writing to the sde_bronze dataset.

1
Restore stateReads _dlt_pipeline_state from bronze through AthenaS3 → runner
2
ExtractGenerator or HTTP; resources read state at extract timerunner memory
3
NormalizeInfers schema, adds _dlt_load_id, _dlt_idrunner disk
4
StageParquet files uploaded by the filesystem destinationsde_bronze_staging/
5
LoadAthena inserts staged files into Iceberg tablessde_bronze/
6
CommitLoad row in _dlt_loads; new state saved with the packagesde_bronze/
7
Clean upRunner ends; staging expires after 7 daysno residue
# ingestion/destination.py (simplified)
destination = dlt.destinations.athena(
    query_result_bucket="s3://<lake>/athena-results/dlt/",
    athena_work_group="sde-demo")
staging = dlt.destinations.filesystem(bucket_url="s3://<lake>")
dlt.pipeline(pipeline_name=f"sde_{name}", destination=destination,
             staging=staging, dataset_name="sde_bronze")

# every resource
@dlt.resource(write_disposition="append", table_format="iceberg")
Rules that keep it correct
  • State inside resources only. Reading it in the source body ran before the restore on fresh CI runners and would have duplicated data
  • Append only. Bronze keeps every load; deduplication is silver's job
  • Idempotent reruns. A rerun with nothing new loads nothing
  • --refresh uses drop_sources: drops that source's tables and state, then reloads from SDE_START_DATE
  • Credentials: default AWS chain (profile, aws login or OIDC)
Westport Horizon LLC|Simple Data Environment · technical overview
Part 2 · Transformation

Bronze to silver: incremental MERGE on dlt load IDs

Silver reads only bronze rows from loads newer than the newest one it has already merged, deduplicates them, then MERGEs them into Iceberg on the business key.

-- models/silver/slv_orders.sql
{{ config(unique_key='order_id',
          partitioned_by=['month(order_date)']) }}
with src as (
  select * from {{ source('bronze', 'orders') }}
  {{ new_dlt_loads_only() }}
),
ranked as (
  select *, row_number() over (
    partition by order_id
    order by updated_at desc, _dlt_load_id desc) as rn
  from src
)
select order_id, store_id, customer_id,
       {{ to_ts('ordered_at') }} as ordered_at, …,
       lower(order_status) as order_status,
       cast(order_total as decimal(14,2)) as order_total,
       _dlt_load_id
from ranked where rn = 1
-- macros/incremental.sql: what new_dlt_loads_only() renders to
where cast(_dlt_load_id as double) > (
  select coalesce(max(cast(_dlt_load_id as double)), 0)
  from sde_silver.slv_orders
)
-- empty on the first run and on --full-refresh

-- dbt_project.yml
silver:
  +materialized: incremental
  +incremental_strategy: merge
  +on_schema_change: append_new_columns
  +table_type: iceberg   +format: parquet
  +write_compression: zstd
Lineage key

_dlt_load_id (a unix-epoch string per run) is kept in every silver row. It links a silver row to the bronze load and the _dlt_loads entry it came from.

Conforming

Types are cast explicitly, codes are upper-cased, emails lower-cased and trimmed, and timestamps are cast to timestamp(6) with to_ts(), which Iceberg needs.

Where it runs

All SQL runs in Athena. dbt on the runner only sends statements. Rows move from sde_bronze/ to sde_silver/ inside S3 and never pass through the runner.

Westport Horizon LLC|Simple Data Environment · technical overview
Part 2 · Transformation

Silver models: keys, deduplication and what changes

Eight models in sde_silver. Seven are incremental MERGEs; the calendar-day FX table is a small full rebuild because late rates can fill earlier gaps.

ModelFrom bronzeUnique key (MERGE)Latest version wins byKey transformations
slv_storesstoresstore_idupdated_at, load idTyped lat/lon, opened_date, upper-case codes
slv_product_versionsproductsproduct_id, price_versionupdated_at, load idKeeps every quarterly price version; valid_from = updated_at
slv_customer_versionscustomerscustomer_id, updated_atload idKeeps every profile version; trims names, lower-cases email
slv_ordersordersorder_idupdated_at, load idStatus lower-cased, money as decimal(14,2), partitioned by month
slv_order_linesorder_linesorder_line_idupdated_at, load idQuantity, unit price, discount and amount typed
slv_fx_ratesfx_ratesrate_date, quote_currencyfetched_at, load idECB business days only: 1 EUR = rate × quote currency
slv_fx_rates_daily(slv_fx_rates)table, full rebuild–Date spine to today; carries the last rate forward; adds EUR = 1.0; keeps source_rate_date
slv_weather_dailyweather_dailystore_id, weather_datefetched_at, load idRenames to temp_*_c, precipitation_mm
Westport Horizon LLC|Simple Data Environment · technical overview
Part 2 · Transformation

Gold: the star schema in sde_gold

Six tables, rebuilt in full on every run. At this size a rebuild costs fractions of a cent and keeps gold consistent with any SCD2 or FX correction upstream.

TableGrainBuilt fromNotes
fct_salesOrder lineslv_order_lines, slv_orders, slv_fx_rates_daily, slv_product_versions, dim_customerLocal and EUR amounts; cost at the price version valid at order time; net_revenue_eur and gross_margin_eur count completed orders only; partitioned by month(order_date)
fct_daily_store_weatherStore × dayslv_weather_daily, fct_salesWeather beside that day's completed orders, units and revenue; temperature bands; is_rainy_day at ≥ 1 mm
dim_customerCustomer versionslv_customer_versionsSCD Type 2: valid_from, valid_to, is_current; md5 surrogate key; age band; unknown member '-1' for guests
dim_productProductslv_product_versionsType 1: current price version; product group (Beverages, Food, Retail)
dim_storeStoreslv_storesCountry name, region (Nordics, Rest of Europe), currency
dim_dateDayGenerated spine2025-01-01 to one year ahead; integer date_key yyyymmdd; ISO week, week and month boundaries, is_past
Keys

Store and product use natural IDs as keys. Customers use md5(customer_id | updated_at).

Relationships

6 single-direction many-to-one joins from the two facts to date, customer, product and store.

Physical

Each rebuild writes a new <uuid> folder under sde_gold/<table>/ and repoints Glue.

Consumers

Power BI (reader user), DBeaver analysts, and analyst sandbox views that join gold.

Westport Horizon LLC|Simple Data Environment · technical overview
Part 2 · Lineage

Table lineage from source to semantic model

Every arrow is a dbt ref() or source(), so this graph is also in the published dbt docs. Column headers show where each layer physically lives.

BRONZE · DLT s3://…/sde_bronze/<table>/ SILVER · DBT INCREMENTAL s3://…/sde_silver/<model>/<uuid>/ GOLD · DBT TABLE s3://…/sde_gold/<model>/<uuid>/ POWER BI · IMPORT workstation: .pbi/cache.abf stores products customers orders order_lines fx_rates weather_daily slv_stores slv_product_versions slv_customer_versions slv_orders slv_order_lines slv_fx_rates slv_weather_daily slv_fx_rates_daily dim_store dim_product dim_customer (SCD2) fct_sales dim_dategenerated fct_daily_store_weather SalesDemo model TMDL · Import mode dim_store dim_product dim_customer fct_sales dim_date fct_daily_store_weather Granularityfield param _Measures89 DAX 2 report pages, 5 tooltip pages Source: Athena ODBC, read-only BI identity cost by version SCD2 join ODBC import dlt load id → new_dlt_loads_only() MERGE on unique_key · CTAS for gold
Westport Horizon LLC|Simple Data Environment · technical overview
Part 2 · Lineage

Column lineage: how one sales line gets its numbers

The columns most reports depend on, traced back to the source field. Joins are point-in-time: every lookup uses the order's own date or timestamp.

fct_sales columnRuleComes fromOriginal source
line_amount_localAs isslv_order_lines.line_amount (decimal 14,2)Generator · order_lines
eur_rateJoin on order_date = rate_date and currencyslv_fx_rates_daily.eur_rate, last ECB rate on or before the dayFrankfurter · fx_rates
line_amount_eurline_amount / eur_rate, cast decimal(14,2)Both rows aboveGenerator + ECB
cost_eurunit_cost_eur × quantity, version where valid_from ≤ ordered_at < valid_toslv_product_versions (first version back-dated to 1900)Generator · products
customer_keySCD2 join on customer_id and ordered_at; no match → '-1'dim_customer ← slv_customer_versionsGenerator · customers
is_completedorder_status = 'completed'slv_orders.order_status (lower-cased)Generator · orders
net_revenue_eurline_amount_eur if completed, else 0Derived in gold–
gross_margin_eurline_amount_eur − cost_eur if completed, else 0Derived in gold–
Westport Horizon LLC|Simple Data Environment · technical overview
Part 2 · Lineage

Point-in-time correctness: three history mechanisms

A sale must carry the customer segment, product cost and exchange rate that applied when it happened, not today's values.

Customer · SCD Type 2
dim_customer
  • One row per version from slv_customer_versions
  • valid_to = the next version's updated_at, else 9999-12-31
  • The first version starts at 1900-01-01, so an order placed seconds before the profile timestamp still matches
  • Guests and unmatched orders → unknown member '-1'
  • Segment, opt-in and email change over time in the mock
Product · price versions
slv_product_versions
  • The catalogue is re-priced every quarter; each price version is a row
  • fct_sales builds [valid_from, valid_to) windows with lead()
  • Cost uses the version valid at ordered_at
  • dim_product itself is Type 1 (current price) for slicing
FX · carry forward
slv_fx_rates_daily
  • ECB publishes on business days only
  • A calendar spine from the first rate to today, crossed with currencies
  • Each day takes the latest rate on or before it; source_rate_date records which one
  • EUR is added at 1.0, so EUR stores join the same way
-- fct_sales.sql: the point-in-time joins
left join fx               on o.order_date = fx.rate_date and l.currency_code = fx.currency_code
left join product_versions pv on l.product_id = pv.product_id and o.ordered_at >= pv.valid_from and o.ordered_at < pv.valid_to
left join customers c      on o.customer_id = c.customer_id and o.ordered_at >= c.valid_from and o.ordered_at < c.valid_to
Westport Horizon LLC|Simple Data Environment · technical overview
Part 2 · Consumption

Power BI: what it reads, how, and where the copy ends up

Import mode: a refresh runs one small Athena query per gold table and stores the result in the local model. Clicks on visuals never reach AWS.

Refresh path
  • Desktop connects through the Amazon Athena ODBC 2.x driver
  • Signs in as a dedicated read-only BI identity that sees only gold
  • Athena runs select … from sde_gold.<table> in workgroup sde-demo-powerbi
  • The result set is written to athena-results/sde-demo-powerbi/ (7 days, this user only), then streamed to Desktop
  • VertiPaq compresses it in memory; saving writes .pbi/cache.abf on the workstation
Semantic model · TMDL
  • 6 gold tables, 6 single-direction relationships
  • dim_date marked as date table; auto date/time off
  • 89 measures in 8 display folders
  • Granularity field parameter: Daily, Weekly, Monthly
Report · PBIR JSON
  • Overview and Trends pages
  • 5 hidden 360 × 300 tooltip pages
  • Westport Coffee theme and logo
  • Rules tested in CI: natural names, no (Blank) cards, real subtitles
Westport Horizon LLC|Simple Data Environment · technical overview
Part 3 · Operations

The daily run, step by step

.github/workflows/pipeline.yml, cron 30 5 * * * (05:30 UTC, after the ECB publishes yesterday's rates). Concurrency group pipeline prevents overlapping runs; timeout 45 minutes.

1
OIDC loginCodeBuild runner in eu-west-1 assumes sde-demo-github-pipeline
2
Ingestrun.py mock fx weather into bronze; erased customers skipped
3
Privacyprivacy.py apply; Sundays: the retention job
4
BuildFreshness (warn only), then dbt build: silver MERGE, gold, 50 tests
5
Lake FormationRe-tag bronze and silver, opt the analyst in
6
MaintainSundays: OPTIMIZE and VACUUM on silver
7
Artifacts, docsdbt artifacts; then docs.yml builds the dbt-docs artifact (14 days)
Manual inputs
  • sources: e.g. "fx weather"
  • full_refresh: rebuild silver from all of bronze
  • maintenance: force Iceberg housekeeping and the retention job
Why reruns are safe
  • dlt state only advances on success, so a rerun picks up exactly the missing days
  • Silver MERGEs on keys, so the same rows never duplicate
  • Gold is rebuilt in full
After the run
  • A Power BI Refresh pulls the new gold data
  • A failure emails the repo owner; gold simply stays at yesterday
  • Typical volume: about 1,200 orders and 2,300 lines per day
Westport Horizon LLC|Simple Data Environment · technical overview
Part 3 · Change management

A code change: from branch to production

Every push and pull request is checked twice: statically, and with a full dbt build against the real bronze data in throwaway databases. Production layers are never touched by CI.

ci / lint-test (every push and PR)
  • ruff check and ruff format --check
  • sqlfluff lint: Athena dialect, jinja templater, no DB needed
  • pytest: generator determinism and shape, weather per city, Power BI report rules
  • dbt parse: the project compiles
  • terraform fmt -check and validate on both stacks
ci / dbt-build (after lint-test)
  • OIDC into the same pipeline role, DBT_TARGET=ci
  • generate_schema_name writes to ci_<run id>_silver and ci_<run id>_gold
  • Reads production bronze; builds every model and test
  • drop_ci_schemas runs with if: always()
  • Skipped for forks and Dependabot, which get no OIDC token
1
BranchChange code; pre-commit runs ruff, sqlfluff, terraform fmt
2
Local builddbt build --select <changed>+
3
Pull requestlint-test, then dbt-build in ci_*
4
MergeCommit body lists what was verified
5
ApplyOn the next pipeline run, or on demand
Westport Horizon LLC|Simple Data Environment · technical overview
Part 3 · Data quality

Data quality controls at every layer

Tests run inside dbt build in DAG order. A failing test stops downstream models, so a broken silver table never reaches gold or Power BI.

Bronze
Freshness
  • loaded_at_field from _dlt_load_id
  • Warn 36 h, error 72 h
  • Weather: warn 7 d, error 14 d
  • Static stores and products: off
Silver
Keys and domains
  • unique and not_null on merge keys
  • accepted_values for order status, segment, currency
  • accepted_range for prices, quantities, FX rates
Gold
Integrity
  • relationships from facts to every dimension
  • Singular test: order totals equal the sum of their lines
  • 50 data tests in all
Report
Rules as tests
  • No raw model names on visuals or filters
  • Cards never show (Blank)
  • Subtitles never repeat titles
  • Every chart has a custom tooltip
Engineering controls
  • Deterministic generator with unit tests, so test failures are reproducible
  • Ingestion tested with an empty DLT_DATA_DIR: the second run must load nothing
  • Measures checked against independent Athena or Python calculations through the Desktop engine port
  • validate_pbir.py checks report JSON against Microsoft's schemas
Where to look
  • Pipeline log, steps dbt source freshness and dbt build
  • run_results.json in the run's artifacts (14 days)
  • Column docs and tests per model in dbt docs
Westport Horizon LLC|Simple Data Environment · technical overview
Part 3 · Governance

Access control: who can touch which layer

Enforced by IAM in infra/terraform/iam.tf at three levels: Glue database or table ARNs, S3 prefixes, and the Athena workgroup. A leaked key exposes only that identity's scope.

IdentityCredentialBronzeSilverGoldSandboxWorkgroupsCannot
Pipeline roleOIDC, ≤ 1 hread/writeread/writeread/writeread/writesde-demoAnything outside this project; drop non-ci_* databases
sde-demo-powerbi-readeraccess keynonenonereadnonesde-demo-powerbi onlySee silver or bronze; write anything; read others' results
sde-demo-analystaccess keyread, no PIIread, no PIIreadfull objectssde-demo-analyst onlyChange managed layers; create or drop databases; read others' results
sde-demo-data-adminaccess keyfullfullfullfullanyIAM, billing, state bucket, bucket config, non-sde_* databases
Your admin useraws loginfullfullfullfullanyUnrestricted (AdministratorAccess)
OIDC trust

The role trusts GitHub's immutable subject repo:<owner>@<id>/<repo>@<id>:*, so a renamed or re-created repo cannot assume it. Repo variables hold the role ARN; there are no secrets.

Keys out of state

Terraform creates users and policies, never access keys. Keys are created with the CLI and live only in ~/.aws/credentials. Rotate yearly, at most two per user.

Guarded workgroups

Each identity queries only through its own workgroup: enforced result prefix that only it can read, SSE-S3, 1 GB per-query scan cap, CloudWatch metrics.

Westport Horizon LLC|Simple Data Environment · technical overview
Part 3 · Governance

Following personal data through the platform

The customer data is synthetic (Faker names, @example.com emails), but its shape is real personal data. We treat it as if it were real, so the controls carry over to production sources.

StepPhysical locationPersonal fields presentCopies keptWho can read
GeneratedRunner memory and dlt package on runner diskfirst_name, last_name, email, city, birth_year, segment, opt-inNone after the jobWorkflow
Stagedsde_bronze_staging/customers/All of the above7 daysPipeline, data admin
Bronzesde_bronze/customers/All, every version, every load3 y after last activity; erasablePipeline, data admin; analyst sees no names or email
Silversde_silver/slv_customer_versions/; customer_id also in slv_ordersAll, every version, normalised3 y after last activity; erasablePipeline, data admin; analyst sees no names or email
Goldsde_gold/dim_customer/No names or email. Keys, city, birth year, segment, opt-in, plus age_bandRebuilt each runAll four identities
Query resultsathena-results/<wg>/Whatever a query selected, including each Power BI import of dim_customer7 daysThe identity that ran it, and the data admin
Power BIWorkstation: VertiPaq and .pbi/cache.abfThe 14 dim_customer columns; no names or emailUntil deleted locallyAnyone with the file or PC
Westport Horizon LLC|Simple Data Environment · technical overview
Part 3 · Governance

Retention, deletion and audit

Append-only bronze and Iceberg snapshots are great for lineage and recovery. So deleting a person's data is scripted: every layer, every snapshot, and the files in S3.

Retention in place today
  • Staging and query results: 7-day S3 lifecycle
  • Silver snapshots: weekly VACUUM per the table's vacuum_max_snapshot_age_seconds
  • Gold: replaced every run; old folder removed by dbt
  • CI databases: dropped after each run
  • Actions artifacts: 14 days; Terraform state versions: 30 days
  • Customers: erased 3 years after last activity; old profile versions after 3 years (Sundays)
Erasure: privacy.py erase <id>
  • Adds the id to the erasure list in sde_governance, which the analyst can't read
  • Deletes profile rows in bronze and silver; orders become guest orders
  • OPTIMIZE + VACUUM: gone from snapshots and S3
  • Rebuilds gold, then verifies every layer and snapshot
  • Ingestion skips listed ids, so reloads can't bring them back
  • Then: refresh Power BI; query results expire in 7 days
Audit trail
  • CloudTrail event history: 90 days of Glue, IAM and S3 control-plane calls, free
  • Athena query history per workgroup: who ran what, bytes scanned
  • _dlt_loads: every load with status and time
  • GitHub: run logs, commits with verification notes, PR reviews
  • Access key last use, per identity
Westport Horizon LLC|Simple Data Environment · technical overview
Part 3 · Governance

Governance gaps and recommended fixes

Acceptable for a demo with synthetic data. Each item should be closed before a real personal-data source is connected.

GapRiskSeverityRecommended fix
Shared athena-results/ prefixThe BI reader and analyst could read results of other identities' bronze or silver queriesFixedDone: one workgroup and result prefix per identity, IAM scoped to each
Names and emails in gold and Power BIDirect identifiers copied to every workstation that refreshesFixedDone: dropped from dim_customer and the Power BI model; they stay in silver
No column-level controlAnalysts read every column of every layerFixedDone: Lake Formation hybrid mode; pii-tagged columns hidden from the analyst
Bronze has no retentionOld profile versions kept foreverFixedDone: 3-year rules, weekly job, privacy.py erase with verification
Processing on GitHub-hosted runnersRows exist briefly on VMs outside our chosen regionFixedDone: data jobs run on a CodeBuild runner in eu-west-1; only the owner's jobs start it
Long-lived access keysStatic keys on workstationsMediumIAM Identity Center with short-lived sessions; keep keys only for the ODBC DSN
SSE-S3, not KMSNo key-level access control or key auditLowSSE-KMS with a customer-managed key and bucket keys
No data classification or catalogSensitivity lives in people's headsLowmeta: {pii: true} in dbt YAML, surfaced in docs and synced to LF-tags
Westport Horizon LLC|Simple Data Environment · technical overview
Part 4 · Further development

Roadmap and summary

The design scales in steps. Each step below adds one capability without replacing the core of S3, Iceberg, Glue, Athena and dbt.

Next · governance
Before real personal data
  • IAM Identity Center for people
Then · platform
Reliability and reach
  • Power BI Service with a gateway for scheduled refresh
  • dbt unit tests and model contracts on gold
  • Alerting on freshness errors (SNS, Slack)
  • SSE-KMS with a customer-managed key
Later · scale
When volumes grow
  • Incremental gold facts with partition overwrite
  • Orchestrator with asset lineage (Dagster) if the DAG grows
  • Real POS or ERP source through a dlt verified source
  • Semantic layer or metrics store shared beyond Power BI
One copy
Row data lives in one EU bucket; everything else is transient or metadata
Traceable
_dlt_load_id links any gold row back to the load that brought it
Rebuildable
Deterministic mock, stateful APIs, idempotent runs, full refresh at any layer
Least privilege
Five identities, no CI secrets, a guarded workgroup each

More: the live report, the platform overview and the dbt lineage docs on the showcase site.

Westport Horizon LLC|Simple Data Environment · technical overview
1 / 24