Client flow
router.refresh() after every event.
Reliability model
- PostgreSQL is authoritative.
- Durable domain events support automation, audit, and webhooks.
- Realtime events carry event type, event version, schema version, workspace, sequence, and a compact payload.
- The client reconnects automatically and performs a focused reconciliation.
- Ephemeral UI events such as
candidate.vieweddo not need durable domain retention.
Event types
The SSE stream emits these event types:
Ephemeral events like
candidate.viewed are not retained in the domain
event outbox and cannot be replayed.
Production guidance
1
One stream per tab
Keep one EventSource connection per browser tab. Multiple streams per
workspace waste connections and produce duplicate events.
2
Invalidate precisely
Invalidate the smallest affected query rather than calling a global
router.refresh() after every event.3
Monitor health
Track SSE p95 latency and reconnect rates. A broken stream must not block
a database mutation or background job.
4
Handle reconnection
After a reconnect, reconcile visible queries by re-fetching the data that
changed during the disconnection window.
Troubleshooting
Next steps
Webhooks
Send events to external systems with signed deliveries.
Automations
Trigger internal workflows on domain events.
API overview
Authentication, rate limits, and response formats.