Marketing Data Ingestion Architecture — Acme Marketing Group
Marketing Data Ingestion Architecture — Acme Marketing Group
Document type: Architecture proposal (TOGAF Phases A–H, condensed) Version: 0.4 draft, 2026-10-27 Author: Kiril Iliev, Enterprise Architect Status: For review. Decisions are recorded as ADRs in decisions/; all are Accepted by the Lead Architect except ADR 8, which awaits the runtime PoCs, and ADR 12 (operations console), which is Proposed.
1. Executive summary
Acme wants Salesforce, HubSpot and Google Ads consolidated into one environment that is timely, complete, recoverable, cost-conscious and easy to extend. The proposal is a medallion lakehouse on Microsoft Fabric with three explicit contracts (Bronze: append-only raw log; Silver: typed current state and history; Gold: tokenised star schema), a small set of source adapters behind one contract, and a change-notification bus derived from the lake's own change feed.
The design rests on five positions, each argued in an ADR:
- One principle, three patterns. Push where the source offers it and the business values it; poll everywhere as the guarantee of completeness. Salesforce gets scheduled polling with optional change-event acceleration; HubSpot gets polling with webhook nudges; Google Ads is polled with trailing windows that absorb restatements (ADR 3).
- "Reconcile or reload" is four operations, not one: recover, reload, replay and reconcile, all made safe by idempotent writes and a control ledger (ADR 5).
- Personal identifiers never reach the lake. An anonymisation gate in the Bronze loader replaces identifiers with random tokens from a separate token vault before anything is written to Bronze; Bronze, Silver, Gold, history and events carry tokens, and erasure is primarily the deletion of a mapping, with an evidence record a regulator accepts (ADR 6).
- Consumers subscribe. Change Data Feed on the business-event table acts as the outbox (events carry deterministic ids, so re-runs and replays are no-ops); a relay publishes to a Service Bus topic; webhooks, Server-Sent Events and Teams alerts are adapters of that bus (ADR 7).
- Fabric over Databricks and over a custom relational build, with the exit criteria stated and all data in open Delta format (ADR 1).
What the business must still tell us is in §9: which changes matter within minutes, what "reload" means to them and how far back, and who may see named individuals.
2. Architecture vision (Phase A)
Problem. Marketing and advertising data lives in three SaaS platforms with different APIs, change semantics and limits. Reporting is per tool; cross-source questions (which campaigns produce opportunities?) cannot be answered; nobody is told when something important changes; there is no way to prove the numbers are complete.
Scope. Ingestion, retention, conformance and serving of Salesforce, HubSpot and Google Ads data; notification of downstream systems; governance of the resulting data. Out of scope: writing back to any source, marketing automation logic, and any system that consumes the events (they are notified, not built).
Drivers and success measures.
| Objective (brief) | Measure |
|---|---|
| Timely visibility into important changes | Tier 1 changes published as business events within 30 minutes of the source change for 99% of runs, and within minutes when the source pushes |
| Historical plus incremental | Full history loaded; incremental loads per tier; no manual exports |
| Reliable and recoverable | Any window re-runnable; reconciliation discrepancy < 0.1% rows per object per day; recovery runbooks tested |
| Cost-conscious | Run cost in the low thousands per month at launch; cost grows sub-linearly with volume |
| Evolvable | New ad source in ≤ 10 working days; new CRM source in ≤ 20 |
Stakeholders. Head of Marketing (sponsor), Marketing Operations, Sales Operations, Finance, Data/BI team, DPO, IT Security, downstream system owners. Interests and concerns in business architecture.
Constraints and assumptions. Microsoft-centric estate with Power BI; Fabric capacity acceptable; GDPR-class privacy obligations; small delivery team; no hard real-time SLA. All assumptions are listed in 00-intake-and-phase-plan.md and §9.
System context. diagrams/01-context.md.
3. Business architecture (Phase B)
The architecture serves seven capabilities: performance reporting, funnel and attribution analytics, operational visibility, spend management, report publication, data governance and privacy, and source onboarding.
The two business definitions that shape everything technical:
Freshness tiers. Not every datum needs the same latency, and each step down in latency multiplies API consumption and capacity use.
| Tier | Latency target | Data |
|---|---|---|
| 1 | ≤ 30 minutes end to end; minutes when the source pushes | Salesforce leads, opportunities, campaign members; HubSpot contacts, deals |
| 2 | ≤ 1 hour | Other CRM objects; Google Ads change history; intraday spend |
| 3 | Daily by 07:00 | Ad performance (trailing 30 days), entity snapshots, engagement events |
| 4 | Weekly or monthly | Restatement true-ups, reconciliation samples, maintenance |
Important changes. A catalogue of business events (lead qualified, opportunity stage changed, campaign budget changed, spend pacing breached, metrics restated, consent changed) with a rule, a tier and likely consumers. It is a proposal for the business to confirm (§9, Q1). Full catalogue in business architecture.
4. Data architecture (Phase C)
4.1 Medallion contracts
| Bronze | Silver | Gold | |
|---|---|---|---|
| Role | The log: what each source said, when | Typed current state and history, conformed | Star schema; the published contract |
| Writes | Append only | MERGE by key and source version; SCD2 history | Rebuild per date; business events inserted if absent on a deterministic id |
| Personal data | Tokens only (landing files before the gate hold identifiers for ≤ 7 days) | Tokens only | Tokens only |
| Schema | Schema-on-read, additive | Contract in Git | Versioned allow-list |
Every row in every layer carries provenance: source, object, batch id, extraction time, the source's own version marker and the mode (incremental, historical, reload, replay). Promotion between layers passes quality gates (keys, uniqueness, referential integrity, freshness, row-count tolerance; at landing → Bronze, the anonymisation gate); failures go to quarantine and block only the affected partition. Detail: ADR 2, data architecture, medallion governance.
4.2 Integrity: recover, reload, replay, reconcile
| Failure mode (brief) | Mechanism |
|---|---|
| Failures and retries | Backoff honouring Retry-After; per-source daily request
budget; circuit breaker; cursors committed per page so a restart
resumes, not repeats |
| Duplicates | Bronze dedupes on version and payload hash; Silver MERGE keeps the latest version; Gold rebuilds days; outbound events carry a deterministic id for consumer-side dedupe |
| Partial processing | A window is either fully landed or not; watermarks advance only on completion |
| Missed changes | Polling is the truth; event streams only accelerate; daily deletion sweeps; Google Ads trailing windows; daily count reconciliation per object per day with automatic targeted reload |
| Recovery and reprocessing | Reload = bounded re-extract from the source; Replay = rebuild Silver and Gold from Bronze with no source calls; time travel to compare before and after |
| Audit | Run ledger, reconciliation history, provenance on every row, lineage in the platform |
Exactly-once is not attempted; at-least-once delivery with idempotent sinks is the contract everywhere. Detail: ADR 5, control tables.
4.3 Personal data and the anonymisation gate
Salesforce and HubSpot contain direct identifiers (names, emails, phones, addresses), behavioural data (email opens and clicks with IP and user agent, web visits, cookie ids), consent status, and employee data on owner and audit fields. Google Ads is aggregate, except that click identifiers become personal once joined to CRM records, and its change history names the employee who made each change. Register: data classification.
The gate runs inside the Bronze loader, between the landing files and the first Delta write, following the right-to-erasure reference design (reference/right-to-erasure-on-a-lakehouse.png): every column must be classified; a PII scan quarantines anything that looks like an identifier elsewhere; identifiers are tokenised by lookup-or-create in a separate token vault (Azure SQL Database under a customer-managed key, Entra-only, PIM access, audited), deterministic per subject so Salesforce and HubSpot join everywhere downstream; the verbatim payload is rewritten with the tokens; free text is dropped; quasi-identifiers are generalised. The lake, its history, its events and its exports therefore never hold an identifier; the landing files are the one place that does, for at most seven days. Erasure is Path A, deleting the subject's mapping in the vault, plus a short Path B for the places with direct identifiers (landing files, logs), per-store verification, and an evidence record appended to immutable storage. Residual tokens are anonymous once the mapping is gone, a position the DPO must confirm (Recital 26). Detail: ADR 6, Bronze loader components, erasure flow.
4.4 Domain model
Canonical entities (person, organisation, opportunity, campaign, ad hierarchy, engagement event, conversion, owner, consent, business event) and their mapping from each source are in domain model; the Gold star schema in gold-star-schema.md.
5. Application architecture (Phase C)
5.1 High-level architecture
A layer-by-layer overview, one band per layer with the sources and the medallion layers marked by icons, is in diagrams/layers-overview.md. The flowchart below adds the push and poll paths, the reconciler and the downstream fan-out.
flowchart LR
subgraph Sources
SF[Salesforce]
HS[HubSpot]
GA[Google Ads]
end
subgraph Extract["Extract: poll guarantees, push accelerates"]
CJ["Copy activity<br/>SystemModstamp, 15 min"]
CDC["CDC consumer<br/>phase 2"]
HSA["HubSpot adapter<br/>search + batch read"]
WH["Webhook receiver<br/>nudges"]
GAA["Google Ads adapter<br/>trailing windows"]
end
subgraph Restricted["Restricted workspace"]
L["Landing files<br/>place 1: identifiers, 7 days"]
GATE{{"Anonymisation gate<br/>in the Bronze loader"}}
B[("Bronze<br/>tokens only, append-only, provenance")]
S[("Silver<br/>MERGE, SCD2, typed")]
C[("Control<br/>ledger, watermarks, recon")]
end
V[("Token vault<br/>Azure SQL, CMK, PIM<br/>the only place erasure must succeed")]
subgraph Analytics["Analytics workspace"]
G[("Gold<br/>star schema, tokens")]
BE[("business_event<br/>CDF on")]
SM["Semantic models<br/>Direct Lake"]
RG["Report generator<br/>versioned definitions, pinned Gold versions"]
end
subgraph Out["Downstream"]
RL[Relay] --> SB[["Service Bus topic"]]
SB --> WD[Webhook dispatcher]
SB --> SSE["Push gateway (SSE)"]
SB --> ACT[Activator to Teams]
RG --> AP["Sign-off"] --> DL["Delivery adapter<br/>contracted channel"]
end
SF --> CJ --> L
SF -.-> CDC -.-> L
HS --> HSA --> L
HS -.-> WH -.-> HSA
GA --> GAA --> L
L --> GATE --> B
GATE <--> V
B --> S
S --> G
S --> BE
G --> SM
G --> RG
BE --> RL
S <--> C
RC[Reconciler] --> C
RC -. counts .-> SF
RC -. counts .-> HS
RC -. counts .-> GA
Container view with technologies: diagrams/02-container.md. Structurizr DSL with context, container, component, dynamic and deployment views: diagrams/structurizr/workspace.dsl (index in diagrams/README.md).
5.2 Ingestion approach per source
| Salesforce | HubSpot | Google Ads | |
|---|---|---|---|
| What the source offers | Change events (72-hour replay), SOQL incremental on
SystemModstamp, Bulk API for history |
Webhooks from a private app (ids only, not records), search on last-modified (10,000-result cap, 5 requests per second), associations API for links, list endpoints for history | Reports by date (restate for days to weeks), entity snapshots, 30-day change history; no push |
| Baseline (completeness) | 15-minute incremental polling via the native Fabric connector; daily soft-delete sweep; Bulk API history | Incremental search polling with keyset paging inside each window; batch read for state and the associations API for links; daily archived sweep; list endpoints for history | Daily entity snapshots; performance for trailing 30 days daily and 90 days weekly; hourly change history |
| Accelerator (latency) | Change Data Capture subscription for hot objects, phase 2 on confirmed need | Webhook nudges from day one; a nudge triggers a targeted read within a minute | None available; intraday pull of today only, every few hours |
| Why not the same pattern | Push exists and is replayable for 72 hours, so it is a safe accelerator | Push exists but carries no state and is best-effort, so it can only be a nudge | No push; restatement makes trailing re-pulls mandatory anyway |
Detail and limits: ADR 3, integration contracts.
5.3 Common framework
Every source, built or bought, sits behind one adapter contract (describe, extract full, extract incremental, count, optional change receiver) and is driven by registries and watermarks in the control schema. Orchestration (Fabric pipelines), extraction (native connector or .NET adapters on Azure Functions) and transformation (Fabric notebooks) are separate components with separate failure modes. Adding a source touches registries, one adapter, one Silver job and Gold mappings; nothing shared. Detail: application architecture, ADR 4, ADR 8, adding a source.
5.4 Downstream: notification and publication
Downstream is two things. Systems and people that must learn of a
change are served by business events on a bus. Clients, partners and
Finance that receive reports are served by a
publication pipeline: report definitions as versioned code, generation
from pinned Gold Delta versions with a manifest, recorded sign-off in
Teams, delivery over the recipient's contracted channel by an adapter
that records evidence, lineage from any published figure back to the
source window through batch ids, and a restatement policy of
version-and-supersede, never overwrite, triggered by the
metrics.restated event (ADR
11, publish
and restate flow).
Notification options considered: a classic outbox table (rejected:
two Delta commits), direct webhooks from the pipeline (rejected:
coupling), Event Grid (viable for webhook-only consumers), Event Hubs
(overkill), Fabric Activator alone (good for humans, not a system
contract), consumer polling (kept for batch consumers), WebSockets or
SignalR from the pipeline (rejected: no durability). Chosen: Change Data
Feed on the business-event table as the outbox log (deterministic event
ids make re-runs and replays no-ops), a relay to a Service Bus topic
with per-consumer subscriptions and dead-letter queues, and adapters for
signed webhooks, Server-Sent Events for dashboards
(TypedResults.ServerSentEvents in .NET 10) and Teams alerts
through Activator. Detail: ADR 7.
6. Technology architecture (Phase D)
6.1 Platform selection
| Option | Verdict | One-line reason |
|---|---|---|
| Microsoft Fabric | Chosen | Native Salesforce connector, Direct Lake reporting without refresh cost, OneLake events and Activator, one capacity bill, open Delta format |
| Azure Databricks | Reserve | Stronger Spark and managed connectors for all three sources, but the HubSpot and Google Ads connectors are still Beta (October 2026), so adapters would be built anyway; two platforms with Power BI; higher cost floor and ops for this volume; re-evaluate above an F64-class load or if ML arrives |
| Custom PostgreSQL / Azure SQL | Fallback | Cheapest under ~20 GB with no Fabric licence, but raw retention, replay and reporting cost scale badly |
Fabric gaps are filled by Azure Functions (webhook endpoint, custom extraction), Service Bus (durable fan-out) and Key Vault (secrets). Detail: ADR 1; management rationale, weighted scoring and cost comparison against Databricks in the platform choice note.
6.2 Estate
Two Fabric workspaces per environment (restricted: landing files, Bronze, Silver, control, pipelines and all notebooks including the Gold jobs and the erasure job; analytics: Gold, semantic models, reports, the report generator) plus a real-time workspace for eventstreams and Activator; one Function App with a storage account for runtime and adapter state, the token vault (Azure SQL Database, customer-managed key), an immutable evidence store, one Service Bus namespace, one Key Vault, Application Insights, Power Automate for approvals; everything from Git through IaC and Fabric deployment pipelines. Detail: technology architecture.
6.3 Serving
Gold is served through Direct Lake on OneLake semantic models (no refresh, no silent fallback), with row- and object-level security in the model rather than at the SQL endpoint, and the SQL analytics endpoint for ad-hoc and batch consumers. Detail: ADR 9.
6.4 Security and source access
Dedicated read-only integration identities per source (Salesforce integration user with a read permission set, an organisational-account consent for the native connector and a JWT flow for coded paths; HubSpot private app with read scopes; Google Ads read-only account with OAuth refresh token under a Google Cloud project at Basic access level; developer tokens were sunset in September 2026), secrets in Key Vault, managed identities for Functions, Entra groups for workspace roles. Nothing is ever written to a source. Detail: ADR 10.
6.5 Scalability and cost
| Driver | Behaviour | Lever |
|---|---|---|
| Fabric capacity | Flat while running; throttles when smoothed background load exceeds the SKU | Incremental loads; small-object Python notebooks; burst capacity for backfills, paused after; split ingest and analytics capacities |
| Storage | Linear, cheap | Retention and VACUUM policy |
| Source API allocations | The real ceiling on freshness | Tiers; reconciliation budget; push accelerators reduce polling |
| Functions, Service Bus, Key Vault | Near zero at idle | Consumption plans |
| People | Dominant | Managed services; one adapter pattern; runbooks |
Expected behaviour: 10× more engagement events moves one Silver job from Python to Spark and the capacity one or two SKUs up; 10× more report users costs nothing in capacity under Direct Lake until the model exceeds SKU memory, though each needs a Power BI Pro licence below F64; each new source adds an adapter and registry rows, not platform work. Order of magnitude at launch, from live West Europe list rates: about 1,580–1,640 EUR a month (list price, excluding VAT) on pay-as-you-go F8 including the token vault and Pro licences for 30 consumers, about 1,150 once reserved, plus a one-off backfill burst of about 1,490. Detail: technology architecture, cost estimate.
7. Opportunities, solutions and roadmap (Phases E and F)
Ten work packages: foundation and credentials (longest lead time: vendor approvals), runtime PoCs (ADR 8), Salesforce path, Google Ads adapter, Gold v1 with the gate and DPO review, HubSpot adapter and webhooks, reload and reconcile tooling, notification bus and adapters, publication pipeline (ADR 11), hardening and governance, plus a conditional Salesforce CDC package. Four transition states, each independently useful. The historical backfill runs per source under its API budget on a temporary burst capacity. Detail: roadmap.
8. Governance and change (Phases G and H)
A lightweight design authority (architect, data lead, dev lead, DPO, security, Marketing Operations) owns the ADRs and four review gates (design, pre-production, pre-launch, post-launch). Layer rules are enforced by permissions and tests, not convention: only the Bronze loader writes Bronze and it hard-fails on an unclassified column or an identifier past the gate; only Silver jobs write Silver; only the Gold jobs write Gold, through an allow-list. Adding a source follows a documented routine with worked examples. Detail: medallion governance, compliance checklist, adding a source.
9. Assumptions, risks and open questions
Key assumptions (full list in 00-intake-and-phase-plan.md): Power BI is the reporting tool and a Fabric capacity is acceptable; GDPR-class obligations apply; data volumes are low millions of CRM rows and tens of millions of engagement events per year; the delivery team can own coded adapters, with the runtime (Azure Functions in .NET or Fabric Python notebooks) decided by the WP0b PoCs (ADR 8); no downstream consumer needs identifiers; no hard real-time SLA.
Top risks (full risk register): HubSpot's 10,000-result cap per search query; Google Ads restatement windows longer than assumed; shared API allocations with other integrations; an unclassified property leaking into Gold; capacity throttling during backfill; the Fabric licensing assumption.
Questions for the business (full wording and consequences in open questions):
- Which changes do you need to know about within minutes, and what will you do with them? Decides the Tier 1 list, whether Salesforce CDC is built, and which notification adapters come first.
- When you say "reconcile or reload", what situation do you have in mind, and how far back must it work? Decides Bronze retention, the Google Ads trailing windows, a closed-period freeze for Finance, and whether reconciliation evidence needs immutable storage.
- Who will use the central data, and does anyone need to see named individuals? Where do those individuals live? Decides whether person-level facts exist in Gold, whether erasure must also delete Gold rows by token, retention, and which consumers get vault-mediated access to identities.
- Is there a shared campaign identifier or naming convention across Salesforce, HubSpot and Google Ads today, or will we need to create and maintain a mapping? Decides whether the campaign dimension in Gold is keyed by a shared identifier or by a platform-maintained mapping table with its own owner (working assumption: a mapping is needed).
Appendix: artefact map
See README.md for the full index, the TOGAF phase map and the mapping to the assessment's expected deliverable.