Acme Marketing Architecture

2. Medallion layering, workspace boundaries and promotion rules

2. Medallion layering, workspace boundaries and promotion rules

Date: 2026-10-26

Status

Accepted


Problem

"Bronze, Silver, Gold" is a naming convention until each layer has a contract: what may be written, by whom, with what guarantees, and who may read it. Without that contract the layers drift into "three copies of the same table". The brief asks for a central environment that is complete, consistent and auditable, and the architect asked for proper medallion governance: Bronze fetches raw, Silver enriches and transcodes, Gold is a star schema.

Two more forces shape the layering: personal data is present in Salesforce and HubSpot (ADR 6), and reload/replay must be possible without touching the sources (ADR 5).


Decision

We will implement three Fabric lakehouses in two workspaces, with the following contracts.

Layer Item Workspace Contract
Landing Files/landing in the restricted lakehouse acme-ingest-restricted The only lake location that holds direct identifiers, for at most 7 days after promotion. Written by the copy activity and the adapters; read only by the Bronze loader; first target of the erasure runbook.
Bronze lh_bronze acme-ingest-restricted Append-only, immutable. One table per source object (sf_lead, hs_contact, gads_campaign_perf). Payload kept verbatim except that identifier fields are replaced by vault tokens at the anonymisation gate (ADR 6); parsed columns; schema-on-read, additive only. Standard provenance columns. Partitioned by ingest date. Never read by consumers.
Silver lh_silver acme-ingest-restricted Typed, deduplicated, conformed names and units. Current-state table per entity via MERGE on business key and source version; SCD2 history table for entities whose history matters (contact lifecycle, deal stage, campaign status, budget). Tokens, not identifiers; still personal data in law while a mapping exists. Internal to the data team. Reconciliation runs against Silver.
Gold lh_gold acme-analytics Star schema: conformed dimensions (dim_date, dim_campaign, dim_channel, dim_account, dim_person_pseudo), facts (fact_ad_performance_daily, fact_lead_funnel, fact_deal_stage_event, fact_engagement). Tokens and aggregates; allow-listed columns. Versioned schema. This is the published contract for reporting and downstream systems. Direct Lake semantic model on top.
Control control schema in lh_restricted (drawn as lh_silver and control in the C4 model) acme-ingest-restricted Watermarks, run ledger, reconciliation results, quarantine, source registry. See control tables.

Physical layout refinement (medallion review, 2026-10-26): where schema-enabled lakehouses are available, each workspace holds one schema-enabled lakehouse rather than one lakehouse per layer: lh_restricted with schemas bronze, silver and control in the restricted workspace, and lh_gold with schema gold in the analytics workspace. The names lh_bronze and lh_silver used throughout these documents and in the C4 model denote those schemas. Schemas keep the OneLake Spark catalog enabled without notebook init cells and allow Materialized Lake Views where they fit; the workspace split, not the lakehouse count, provides the access boundary.

Promotion rules (enforced in the pipeline, checked in review):

  1. Landing → Bronze only through the Bronze loader, which runs the anonymisation gate: an unclassified column or an identifier found by the PII scan fails the run before any write.
  2. Bronze → Silver only through the Silver job for that object; the job is idempotent for any window.
  3. Silver → Gold only through the Gold jobs (the 15-minute Tier 1 event job and the star build); Gold fact tables are rebuilt per date with replaceWhere, never merged row by row; only allow-listed columns are written. The one Gold table written by MERGE is business_event, inserted-if-absent on a deterministic event_id.
  4. Every table carries _batch_id, _source, _extracted_at, _source_version; Gold carries _built_at and _gold_schema_version.
  5. Schema changes: Bronze is additive by default but every new column needs a classification entry before the gate lets it through; Silver requires a contract change in Git; Gold requires a version bump and a note to consumers.
  6. Data quality gates per promotion: non-null keys, unique keys, referential integrity to dimensions, freshness within tier, row-count delta within tolerance. Failures write to quarantine and block the partition, not the whole run.
  7. Table maintenance: OPTIMIZE with V-Order weekly; VACUUM at 7 days for Bronze and Silver, 30 days for Gold (time travel for audit); log retention 90 days. Change Data Feed is enabled on Silver tables and on gold.business_event only; Gold facts are rebuilt by day, so a change feed on them would show whole-day churn, not changes.

Considered Options

Option Summary Pros Cons
✅ Three lakehouses, two workspaces Access boundary between restricted (Bronze, Silver) and analytical (Gold) Enforces DP-06 by permission, not naming. Gold can be shared widely. Clear ownership. Cross-workspace shortcuts or the Gold jobs reading Silver need explicit permissions; slightly more setup.
One lakehouse, three schemas, one workspace bronze.*, silver.*, gold.* in one item Simplest. Single SQL endpoint. No access boundary between the landing files, the vault-capable identity and analysts without SQL-endpoint security, which trips Direct Lake fallback. Rejected on DP-06 and ADR 9.
Two layers (raw and curated) Skip Silver Fewer jobs. Reconciliation needs a typed current-state layer, and the star schema cannot be built directly from raw JSON without one. Rejected.
Warehouse item for Gold T-SQL, multi-table transactions, Direct Lake also works Familiar to SQL teams; cross-table atomic commits. Spark-written Delta is sufficient; Warehouse adds a second write engine and its own quirks. Revisit if analysts need T-SQL DML on Gold.
Materialized Lake Views for Silver and Gold Declarative Spark SQL views with managed, sometimes incremental, refresh (requires a schema-enabled lakehouse) Less orchestration code; refresh schedules managed by the lakehouse; lineage visible. The facts need day-level replaceWhere rebuilds and business_event needs insert-if-absent, neither of which an MLV expresses; MLVs cannot write across workspaces. Candidate for simple aggregates (for example fact_spend_daily from fact_ad_performance_daily); decided per table at G1.

Consequences

Positive:

Negative / Trade-offs:

Risks: | Risk ID | Description | Impact (E/H/M/L) | Mitigation | |---------|-------------|------------------|------------| | R1 | Analysts bypass Gold and query Silver for "one extra column" | M | Workspace permissions; Gold change process in adding a source | | R2 | Bronze grows without bound | L | Storage is cheap; retention policy in data architecture; OPTIMIZE and VACUUM scheduled |