Acme Marketing Architecture

3. Ingestion pattern per source: push accelerates, poll guarantees

3. Ingestion pattern per source: push accelerates, poll guarantees

Date: 2026-10-26

Status

Accepted


Problem

The three sources expose change in different ways, and the brief warns against one pattern for all:

Source Push mechanism Pull mechanism Hard limits that shape the design
Salesforce Change Data Capture events over the Pub/Sub API; events replayable for 72 hours by replay id SOQL on SystemModstamp; Bulk API 2.0 query jobs for history; queryAll for soft-deleted rows Daily API request allocation per edition and licence; CDC event delivery allocation (add-on may be required); CDC excludes some field types
HubSpot Webhook subscriptions from a private app (propertyChange, creation, deletion, …), payload carries object id and property, not the record; up to 1,000 subscriptions per app CRM v3 list endpoints (history), search endpoint filtered on hs_lastmodifieddate (incremental), batch read by id Search caps at 10,000 results per query (paging past the cap returns 400), so windows must be sized under it; 100–190 requests per 10 s per app; 250k–1M requests per day per account; archived objects visible for a limited period
Google Ads None GAQL reports via searchStream segmented by date; entity snapshots; change_event for audit Performance metrics restate for days to weeks (conversion lag and adjustments); change_event reaches back 30 days and 10,000 rows per query; daily operation quota tied to the Google Cloud project's access level

The business wants timely visibility into important changes (minutes for some CRM events) and complete, auditable history. Event streams cannot give completeness: Salesforce replay expires, HubSpot webhooks are best-effort and carry no record state, Google Ads has nothing to subscribe to.


Decision

We will apply one principle to all three sources, push accelerates, poll guarantees (DP-03), and a different concrete pattern per source.

Salesforce

HubSpot

Google Ads

The polling path for every source is sufficient to rebuild any window from the source, as far back as the source retains data. The push paths only reduce latency.


Considered Options

Option Summary Pros Cons
✅ Per-source pattern under one principle Poll everywhere; push where it exists and is valued Completeness independent of event retention; latency where it matters; one reconciliation design Two paths to operate for Salesforce and HubSpot
Push as the system of record CDC and webhooks feed Silver directly; polling only for history Lowest latency; fewest API calls Any gap (72-hour outage, dropped webhook, CDC field exclusions) silently loses data; Google Ads cannot do it anyway; reconciliation becomes a full re-pull. Rejected.
Poll only, everywhere Same schedule for all sources Simplest; one path Minutes-level visibility only by polling more often, which burns API allocation on Salesforce and HubSpot; ignores the brief's hint that some sources notify. Rejected for CRM, adopted for Google Ads.
Scheduled full reload nightly Re-extract every object every night Trivially idempotent; no watermarks API allocation and time grow linearly with data; no intraday freshness. Adopted only for Google Ads entity snapshots, which are small.
Third-party replication (Fivetran, CData Sync open mirroring) Vendor handles each API Fastest to stand up for Salesforce; HubSpot and Google Ads covered by Fivetran Cost scales with monthly active rows; restatement and reload semantics are the vendor's; credentials held by a third party. See ADR 4.
HubSpot GraphQL endpoint for extraction One nested query per object graph instead of search, batch read and associations calls Fewer round trips for contact, company and deal trees; one call carries properties and links Each query stops at 30,000 complexity points and returns a partial result under HTTP 200; the account-wide pool (500,000 points per minute) is shared with CRM UI extensions; the endpoint is built for CMS data-driven content, not bulk extraction. Rejected; the REST search, batch and associations endpoints with explicit limits stay (PoC brief).
Eventstream to a KQL database for HubSpot webhooks Capture webhook payloads in Real-Time Intelligence and conform them with update policies Native real-time store; no code for the stream HubSpot webhooks carry ids and property names, not records, so there is nothing to conform; a KQL store duplicates Bronze; a public endpoint that validates the v3 signature is still needed in front. Rejected; webhooks stay nudges (ADR 7).
Azure Event Hubs for the nudge path (researched 2026-10-26, finding C17) The receiver publishes nudges to a Basic-tier hub, one partition per portal; the worker is an Event Hubs trigger with minEventBatchSize and maxWaitTime Partition ownership gives one in-flight consumer without sessions; replay by offset for a day; best-effort semantics explicit (checkpoint, no dead-letter); about 10 EUR a month for one throughput unit; the same hub could feed a Fabric eventstream One more service next to the Service Bus namespace that data-changed needs anyway; batching under trickle is equally available on the Service Bus trigger; no dead-letter diagnostics. Rejected for now by the Lead Architect; Service Bus with batch settings stays.
Azure Event Grid for the nudge path Custom topic, Functions Event Grid trigger Cheapest at low volume (about 0.53 EUR per million operations, no base fee); 24-hour retries and dead-lettering to storage Delivers per event and fans out across instances, which breaks the one-in-flight-consumer rule the rate budget relies on. Rejected.

Consequences

Positive:

Negative / Trade-offs:

Risks: | Risk ID | Description | Impact (E/H/M/L) | Mitigation | |---------|-------------|------------------|------------| | R1 | HubSpot search caps any query at 10,000 rows, and offset paging skips a row whenever a record leaves the window mid-run | M | Keyset paging on hs_object_id inside the window, each request a fresh query; count per window for reconciliation; verify the GT filter on the live portal | | R2 | Salesforce CDC allocation or field exclusions produce incomplete events | M | Polling remains the truth; CDC only for hot objects; confirm allocation per edition | | R3 | Google Ads restatement window longer than 90 days for some conversion actions | M | Quarterly 180-day true-up for conversion metrics; document conversion windows per action | | R4 | The Google Cloud project for Google Ads stays at Explorer access (2,880 operations per day on production) | M | Apply for Basic access (brand verification) in WP0; Basic's 15,000 per day covers the assumed volumes because SearchStream counts one operation per query; Standard only if that is exceeded; the adapter throttles against the ledger |