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
- Baseline (launch): incremental polling on
SystemModstampevery 15 minutes for the in-scope objects listed in the integration contract, using the Fabric Data Factory Salesforce connector (copy activity) to land each window as files, which the Bronze loader promotes with dedupe and provenance exactly as for the other sources. The connector authenticates as a dedicated integration user through an organisational-account consent held in the Fabric connection; it does not support the JWT bearer flow (ADR 10). DailyqueryAllsweep forIsDeletedrows. Historical load through Bulk API 2.0 query jobs per object, chunked byCreatedDateranges. - Accelerator (phase 2, when a sub-15-minute need is confirmed, see
open question Q1): a Pub/Sub API CDC subscription on the hot objects
(Lead, Opportunity, CampaignMember). A consumer persists the last replay
id after each commit, lands events in
bronze.sf_cdc_event, and the Silver job treats them like any other row version. Polling keeps running and is the completeness guarantee; the 72-hour replay window is a latency buffer, not a store.
HubSpot
- Baseline: incremental polling of CRM objects (contacts, companies,
deals, tickets, marketing emails, forms) on
hs_lastmodifieddatethrough the search endpoint, hourly for most objects and every 15 minutes for contacts and deals. Pages are read by keyset onhs_object_idinside the window (one sort rule, no offset), so no request pages past the 10,000 cap and a record modified mid-run cannot shift a page; a count per window serves reconciliation. Current state is fetched with batch read (100 ids per call). Daily sweep of archived objects for deletions. Historical load through the list endpoints (paged, not capped), or the async export API for very large portals. Engagement and email events through the events API by time window. - Accelerator (launch, because it is cheap): private-app webhook
subscriptions on contact, deal and company property changes. The
receiver validates the v3 signature, acknowledges immediately, and
enqueues the object ids. A session-triggered worker receives the nudges
in batches (
minMessageBatchSize100,maxBatchWaitTime10 s: a few seconds of latency for about sixteen times fewer requests when nudges trickle: 89 batch reads instead of 1,500 in the PoC, WP0b finding C17), batch-reads those ids within a minute and lands them as landing files withop=webhook_nudge; the next Bronze loader run promotes them through the gate (ADR 2). Webhooks are a nudge, never the truth: a missed webhook is caught by the next poll.
Google Ads
- Pull only. Entities (customer, campaign, budget, ad group, ad,
keyword) as a daily full snapshot per customer account (small; SCD2 in
Silver). Performance reports (campaign, ad group, keyword, geographic
and conversion views) segmented by date, pulled daily for the trailing
30 days and weekly for the trailing 90 days to absorb restatements; Gold
partitions for those dates are overwritten. Optional intraday pull of
today only every 2–4 hours for spend pacing.
change_eventpulled hourly, paged by timestamp, for operational visibility of budget, bid and status changes. Customer accounts enumerated from the manager account.
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:
- A source outage or event gap never corrupts the lake; it delays it, and reconciliation measures the delay.
- Freshness is tiered by business value (business architecture), not by what each API happens to offer.
Negative / Trade-offs:
- Salesforce and HubSpot each have two ingestion paths; both must be monitored.
- Google Ads trailing-window re-pulls cost API operations every day; the window is a tunable.
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 |
Related
- Related ADRs: 4, 5, 8, 10
- Related requirements: Ingestion strategy; Freshness; Source limitations; Reliability and recovery
- Related documents: integration contracts, sequence diagrams, Azure data movement options (infographic)
- Principles: DP-03, DP-04, BP-04
- TOGAF phase: C (Application)
- Decision maker(s): Lead Architect
- Stakeholders: Marketing Operations, Sales Operations, platform owners for each source