offplan · online
Decision · 0012-realtime-sync

0012 — Real-time sync architecture (Buyer Remote Presentation)

Shell-Pending-Tech-Estimatedecision0012-realtime-sync

Context

Phase 1.11.6-1.11.8 — Buyer Remote Presentation flow: Sales Agent в админке нажимает «Remote Presentation» → генерируется ephemeral link (1h default) → buyer открывает на своём девайсе → всё что SA делает на экране (view changes, unit selection, filters) реплицируется у buyer real-time.

Narrow scope per CONV-31 L3: этот ADR покрывает только use-case A (Buyer Remote Presentation). Use-case B (unit status sync между Sales Agents) — defers to Phase 1.10 implementation как simple polling, без отдельного ADR.

Phase 1.11.6-8 риски Stage-2 deferral (если timeline tight) — поэтому investment в общую Real-time Platform не оправдан сейчас. Status field shell-pending-tech-estimate reflects: ADR reserves number + scope + alternatives для discussion с Илья + командой, но финальный architecture pick откладывается до tech estimate.

Open Questions

Architectures Considered

Variant Build Ops cost Latency Notes
A. Polling (REST endpoint, buyer пингует server каждые 2-5s) 🟢 simplest (regular HTTP) 🟡 traffic-heavy 🔴 2-5s Не feels «real-time» для presentation use-case
B. SSE (Server-Sent Events, server-only push) 🟢 simple (one-way push) 🟢 cheap 🟡 sub-second Sufficient если bi-directional не нужен
C. WebSocket (self-hosted gateway) 🟡 complex (reconnect handling, scaling) 🟡 stack-dependent 🟢 < 200ms Bi-directional, full control
D. Managed (Pusher / Ably / Supabase Realtime) 🟢 fastest ship 🔴 ~$50-200/mo 🟢 < 200ms Vendor-dependent, but minimal ops

Decision Criteria

Resolves at

Pending Илья tech estimate (Илья provides hours estimate per architecture variant) + sub-plan plans/buyer-profile-and-presentation.md ratification (sub-plan owns 1.11.1-8 detail spec). Architectures table — discussion artefact для Илья + команды.

If Phase 1.11.6-8 deferred to Stage 2 → ADR 0012 marked superseded-by (Stage 2 ADR) and re-opened когда Phase resumes.

Cross-references: ADR 0009 (Buyer entity + tokenised URL routing) · Phase 1.11.6-8 (implementation home).