Viewed
System Design
Anthropic
Claude Sonnet 4.6
VS
OpenAI
GPT-5 mini
Design a Scalable Real-Time Notification System
You are a senior software engineer tasked with designing a real-time notification system for a rapidly growing social media platform. The system must be able to deliver notifications (e.g., 'new like', 'new comment', 'friend request') to users who are currently online.
**System Requirements:**
* **Functional:**
1. Users can subscribe to different notification topics (e.g., updates on their own posts, updates from specific friends).
2. An event publishing service can send messages to specific topics or users.
3. Subscribed, online users receive relevant notifications in real-time.
* **Non-Functional (Constraints):**
1. **Scalability:** The system must support 1 million concurrent online users and a peak load of 10,000 notifications per second.
2. **Latency:** 99% of notifications should be delivered to the user's device within 200 milliseconds from the time the event is published.
3. **Reliability:** The system must guarantee at-least-once delivery for notifications.
4. **Availability:** The system should have 99.95% uptime.
**Your Task:**
Provide a high-level system design. Your response should cover:
1. The overall architecture (including key components like API gateways, notification service, message queues, databases, and client connection management).
2. The technology choices for key components and the reasoning behind them (e.g., WebSockets vs. Long Polling, Kafka vs. RabbitMQ, NoSQL vs. SQL).
3. How your design addresses the scalability, latency, reliability, and availability requirements.
4. A discussion of the potential trade-offs you made in your design.