Design: Message Delivery Guarantee System
Design the core message delivery system focusing on delivery guarantees and reliability. Out of scope: client UI, advanced analytics, and message content processing.
Functional Requirements
FR1: Support three delivery guarantees: at-most-once, at-least-once, exactly-once
FR2: Allow clients to send and receive messages reliably
FR3: Handle message loss, duplication, and ordering issues
FR4: Provide APIs for sending and receiving messages
FR5: Support message persistence to avoid data loss
FR6: Allow scaling to handle 100,000 messages per second
FR7: Ensure p99 latency for message delivery under 200ms
Non-Functional Requirements
NFR1: System must be highly available with 99.9% uptime
NFR2: Support horizontal scaling for throughput
NFR3: Use standard protocols (e.g., REST, gRPC) for client communication
NFR4: Message storage must be durable and consistent
NFR5: Latency target: p99 < 200ms for message delivery
NFR6: Handle network failures gracefully
