Design: Event Sourcing System
Design covers event storage, event processing, state rebuilding, and read model projection. Out of scope are UI design and specific business domain logic.
Functional Requirements
FR1: Store all changes to application state as a sequence of events.
FR2: Rebuild current state by replaying events.
FR3: Support querying current state efficiently.
FR4: Allow auditing and debugging by inspecting event history.
FR5: Support event versioning and schema evolution.
FR6: Handle concurrent updates safely.
Non-Functional Requirements
NFR1: System must handle 10,000 events per second.
NFR2: Event replay latency for rebuilding state should be under 5 seconds for 1 million events.
NFR3: Availability target of 99.9% uptime.
NFR4: Event storage must be durable and immutable.
NFR5: Support eventual consistency for read models.
