Design: Event Store System
Design the core event store service and its API for microservices. Out of scope: event consumer implementations, UI, and event processing logic.
Functional Requirements
FR1: Store all changes to application state as a sequence of events.
FR2: Support appending new events in order with strong consistency.
FR3: Allow querying events by aggregate or event type.
FR4: Support replaying events to rebuild current state.
FR5: Provide an API for microservices to publish and consume events.
FR6: Ensure durability and fault tolerance of stored events.
Non-Functional Requirements
NFR1: Handle up to 10,000 events per second.
NFR2: API response latency under 200ms for event appends and queries.
NFR3: 99.9% availability (less than 8.77 hours downtime per year).
NFR4: Events are immutable and never deleted.
NFR5: Support eventual consistency for event consumers.