Design: Message Ordering Guarantee System
Design focuses on the messaging system's ordering guarantees and core architecture. It excludes detailed security, user interface, and persistence backup strategies.
Functional Requirements
FR1: Ensure messages sent between distributed components are received in the correct order.
FR2: Support multiple ordering guarantees: no ordering, per-producer ordering, global ordering.
FR3: Handle message loss and retries without breaking ordering guarantees.
FR4: Allow scalable message throughput with low latency.
FR5: Provide APIs for producers to send messages and consumers to receive messages in order.
Non-Functional Requirements
NFR1: System must handle up to 100,000 messages per second.
NFR2: End-to-end message delivery latency should be under 200ms for 99th percentile.
NFR3: Availability target of 99.9% uptime.
NFR4: Support horizontal scaling of producers and consumers.
NFR5: Ordering guarantees must be maintained even under failures and retries.