Phase 10: Real-Time Vision¶
Document Type: Vision Statement
Phase: 10 - Real-Time Subscriptions
Status: Active
Goal¶
Enable real-time event subscriptions over WebSocket, allowing clients to receive database changes as they happen, while preserving AeroDB's determinism guarantees where possible.
Philosophy¶
Determinism Boundary¶
AeroDB introduces a clear determinism boundary in Phase 10:
| Layer | Determinism | Guarantee |
|---|---|---|
| WAL | Deterministic | Same writes → Same log |
| Event Log | Deterministic | Same WAL → Same events |
| Dispatcher | Non-Deterministic | Best-effort delivery |
| Client | Non-Deterministic | Must handle out-of-order |
Key Insight: The Event Log is the last deterministic layer. Clients see a projection that may differ due to network conditions.
Core Principles¶
- Event Log as Source of Truth - Database events derived from WAL
- Explicit Non-Determinism - Dispatcher makes no ordering guarantees
- RLS-Filtered Delivery - Events filtered per-user before dispatch
- Fail-Open for Delivery - Missed events don't crash the system
- Explicit Subscriptions - No implicit broadcast
Non-Goals¶
- Exactly-once delivery (at-least-once is acceptable)
- Global ordering of events across all clients
- Guaranteed delivery (clients must handle reconnection)
- Persistent event history (events are ephemeral)
Success Criteria¶
- Clients receive events within 100ms of commit (p95)
- RLS filtering applied to all events
- System handles 10k concurrent WebSocket connections
- Clean reconnection with resume from sequence number