Status: Accepted (in force). Verified 2026-07-21.
Context
The Warehouse (RFD-001) is a copy of operational data. A copy needs a refresh strategy. Options: refresh on every operational write (transactional, always current, but couples every write to warehouse maintenance), or refresh periodically (decoupled, but lagging).
Decision
Refresh periodically, via DataSynchronizationService — a BackgroundService on a 30-second loop that calls SyncBIData() across the domain services:
every 30s: Person, Payroll, Requests, Contractor, Payment .SyncBIData()
+ SyncContactData, EWA employees → CleanupDataSyncTask()
So the Warehouse — and therefore all reports and dashboards — is eventually consistent, trailing live data by up to ~30 seconds plus the sync duration.
Consequences
Good:
- Writes stay cheap. Operational transactions don't pay a warehouse-maintenance cost; the sync is decoupled and batched.
- Near-real-time in practice. 30s is short enough that reports feel current for almost all uses.
- Resilient. A missed cycle just retries next tick; no write is blocked by warehouse trouble.
- Per-service sync means one domain's sync can be tuned/fixed without touching others.
Bad / costs:
- Reports are not transactionally consistent with live data. A change made "now" isn't in reports until the next sync — the #1 "reporting bug that isn't a bug." Docs/support must keep explaining it. (knowledge-base, how-to §10)
- Silent staleness on failure. If the worker or a
SyncBIData() path fails, reports quietly age with no user-facing error — needs monitoring. (runbook §1-2)
- Constant load — a 30s loop syncing five domains per tenant is standing work (cf. the EWA 30s workers).
- Partial staleness — one domain's sync can lag while others are fresh, so a cross-domain report can be internally inconsistent for a window.
Guidance
- Treat report data as seconds-fresh, not instant; don't build features that assume read-your-writes on reports.