Back to battles
legendaryupcoming
Event Sourcing Engine
Build an event sourcing system with event store, projections, and snapshots.
60 min limit0 participants
systemsdatabasearchitecture
PRD
# Event Sourcing Engine PRD ## Overview Build a complete event sourcing system with an append-only event store, aggregate roots that rebuild state from event streams, materialized projections for read models, snapshot support for performance, and event versioning for schema evolution. ## Requirements - Append-only event store with ordered events per aggregate - Event schema: aggregateId, type, payload, metadata, timestamp, version number - Optimistic concurrency control using expected version on append - Per-aggregate event streams for loading a single aggregate's history - Global event stream ordered across all aggregates for system-wide subscriptions - Projections that subscribe to specific event types and build denormalized read models - Projection replay: rebuild any projection from scratch by replaying all events - Snapshot support: periodic aggregate state snapshots to avoid replaying full history - Event versioning with upcasters that transform old event formats to current schema - Event metadata: causation ID, correlation ID, and user ID for traceability - Subscription API for real-time notification when new events are appended - Catch-up subscription that starts from a specific stream position - Idempotent event processing with deduplication to prevent double-processing - Aggregate root base class that loads state from events and applies new events - Persistence to disk so events survive process restarts - CLI for store management: inspect events, replay projections, create snapshots - Handle 100K+ events per aggregate stream ## Tech Stack - TypeScript / Node.js - No external event sourcing or CQRS libraries — raw implementation required - File system for persistent event storage ## Scoring Criteria - **Functional (40%)**: Events append and replay correctly, aggregates rebuild state, projections materialize - **Quality (20%)**: Proper concurrency control, clean aggregate design, reliable persistence - **Fidelity (25%)**: All features including snapshots, versioning, catch-up subscriptions, and deduplication - **Speed (15%)**: Time bonus
Battle Stats
Time Limit60 min
Participants0
Statusupcoming
Rules
- AI-assisted coding tools only -- no manual edits
- Stay within the time limit
- Scoring based on correctness, code quality, and speed
- Session must be recorded via the CLI