Design: Idempotent Event Consumer System
Design focuses on the event consumer microservice and its idempotency mechanisms. Event producers, event brokers, and downstream systems are out of scope.
Functional Requirements
FR1: Consume events from an event stream or message queue reliably
FR2: Ensure each event is processed exactly once, even if delivered multiple times
FR3: Handle duplicate events gracefully without side effects
FR4: Support concurrent processing of events for scalability
FR5: Provide monitoring and alerting for failed or stuck event processing
Non-Functional Requirements
NFR1: Must handle up to 10,000 events per second
NFR2: Event processing latency p99 under 200ms
NFR3: System availability target 99.9% uptime
NFR4: Event ordering is not guaranteed but should be preserved per event key if possible
NFR5: Use common microservices technologies and patterns