Design: Producer-Consumer Messaging System
Design focuses on the messaging system core with producers, consumers, and message queue. Out of scope are producer and consumer internal logic and UI.
Functional Requirements
FR1: Allow multiple producers to send messages asynchronously
FR2: Allow multiple consumers to receive and process messages independently
FR3: Ensure messages are processed in the order they are produced
FR4: Support message durability to avoid data loss
FR5: Handle varying rates of production and consumption without losing messages
Non-Functional Requirements
NFR1: System should handle up to 10,000 messages per second
NFR2: Message processing latency p99 should be under 500ms
NFR3: System availability should be at least 99.9%
NFR4: Messages must not be lost even if consumers are temporarily down