Event Projections Architecture: CQRS with Redpanda
The Command/Projection/Query separation using Firebase Callable Functions, Postgres Outbox, and Rust normalizer worker for real-time Firestore projections.
- Architecture
- Redpanda
- Firestore
- Realtime
What shipped
- Commands:
ingestEventcallable function publishes toapp-eventstopic - Reliable Delivery: Transactional Outbox in Django +
outbox_relayfor publishing - Projections:
telemetry_workerconsumes events and materializes into Firestore - Queries: Direct Firestore subscriptions for real-time UI updates
Technical flow
- Client submits event → Firebase callable (
version,idempotency_key) - Django writes OutboxEvent atomically with main transaction
- Outbox relay publishes to Redpanda with Kafka compatibility
- Rust normalizer (or Python worker) consumes with idempotency
- Projections written to
demlFirestore database - UI subscribes via Firestore SDK for real-time updates
Why it mattered
This architecture enables horizontal scaling without state coordination. The platform showcase (Tenant0) processes identically to customer tenants through the same code path. Versioned events provide governance for schema evolution.