Acme Marketing Architecture

Sequence: reconcile, targeted reload, and replay

Sequence: reconcile, targeted reload, and replay

The daily reconciliation compares source counts with Silver per object and per source-modified-day. A discrepancy above tolerance schedules a bounded reload from the source. A replay (bottom note) rebuilds Silver and Gold from Bronze with no source calls.

sequenceDiagram
    autonumber
    participant SCH as Scheduler (daily)
    participant RC as Reconciler
    participant SRC as Source API
    participant S as Silver
    participant L as Control
    participant ORC as Orchestrator
    participant AD as Adapter
    participant B as Bronze
    participant SJ as Silver job
    participant GJ as Gold jobsss
    SCH->>RC: reconcile(object, trailing 35 days)
    loop per source-modified-day
        RC->>SRC: count(object, day)
        RC->>S: count(object, day)
        RC->>L: reconciliation_result (delta, verdict)
    end
    alt delta > tolerance
        RC->>L: reload_request(object, window, reason=recon)
        ORC->>L: pick reload_request (budget check)
        ORC->>AD: extract_incremental(object, window, mode=reload)
        AD->>SRC: pages for window
        AD->>B: append new versions (mode=reload)
        ORC->>SJ: silver(object, window)
        SJ->>S: MERGE by key and version (idempotent)
        ORC->>GJ: gold(partitions touched)
        GJ->>GJ: overwrite partitions, emit metrics.restated if a closed day moved
        ORC->>L: run landed, reconciliation re-check
    else delta within tolerance
        RC->>L: verdict ok
    end
    Note over B,GJ: Replay (logic change) runs SJ and GJ only, reading Bronze, no source calls

The four operations side by side

Operation Entry point Reads from Writes to API cost
Recover Failed run restarts from page_cursor Source (remaining pages) Bronze, ledger Remaining pages only
Reload reload_request(object, window) Source (bounded window) Bronze (new versions), Silver, Gold partitions Window size
Replay silver(object, window) and gold(partitions) with mode=replay Bronze, Silver Silver, Gold None
Reconcile Scheduled, or after an incident Source counts, Silver counts reconciliation_result, reload_request One count per object per day