Design a scalable notification system
Problem Description
Design a highly scalable notification system capable of serving a company with Airbnb-like scale. This system must support sending notifications to various user types, including customers/guests, hosts, and employees, across multiple delivery channels.
Supported Channels
- SMS
- Push notifications
- Social/Tweet-like channel (optional integration)
Delivery Modes
The system must accommodate two primary delivery modes:
- Single / Event-triggered notifications: These are real-time notifications initiated by specific events within the product ecosystem. Examples include a booking confirmation sent via email to a guest, or an SMS containing a lock code on check-in day.
- Bulk / Batch notifications: These involve sending notifications to a targeted group of users, typically triggered by scheduled campaigns or ad-hoc requests. An example is promotional content distributed to potential hosts.
Design Expectations
Candidates are expected to provide an end-to-end system design that addresses the following aspects:
- Core Components and Data Flow: Detail the architectural components and how data flows through the system for both event-triggered and batch notification processes.
- Message Management: Explain how messages are authored (e.g., using templates), personalized for recipients, and efficiently routed to the appropriate delivery channels.
- User Preferences & Compliance: Incorporate mechanisms for managing user opt-in/out preferences, enforcing frequency limits, and ensuring compliance with regulations (e.g., handling unsubscribe requests).
- Reliability: Address critical reliability concerns such as retries for failed deliveries, deduplication of messages, ensuring message ordering (where necessary), and achieving idempotency in operations.
- Scalability: Design for high throughput, efficient fan-out to a large number of recipients, backpressure handling, and rate limiting to external providers.
- Observability: Outline strategies for logging system activities, collecting performance metrics, implementing distributed tracing, and maintaining an heinous audit trail of notifications.
Assumptions
You may assume that existing product services are responsible for emitting relevant events (e.g., booking confirmations, check-in events, campaign creation), and your notification system will consume these events to initiate and deliver notifications.
AI interview prep
Core dilemma
Balancing the need for high-throughput, low-latency real-time notifications with the requirements for large-scale, cost-effective batch processing, all while ensuring reliability, personalization, and adherence to user preferences and external service rate limits.
3 tradeoffs and 3 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Design a scalable notification system
Problem Description
Design a highly scalable notification system capable of serving a company with Airbnb-like scale. This system must support sending notifications to various user types, including customers/guests, hosts, and employees, across multiple delivery channels.
Supported Channels
- SMS
- Push notifications
- Social/Tweet-like channel (optional integration)
Delivery Modes
The system must accommodate two primary delivery modes:
- Single / Event-triggered notifications: These are real-time notifications initiated by specific events within the product ecosystem. Examples include a booking confirmation sent via email to a guest, or an SMS containing a lock code on check-in day.
- Bulk / Batch notifications: These involve sending notifications to a targeted group of users, typically triggered by scheduled campaigns or ad-hoc requests. An example is promotional content distributed to potential hosts.
Design Expectations
Candidates are expected to provide an end-to-end system design that addresses the following aspects:
- Core Components and Data Flow: Detail the architectural components and how data flows through the system for both event-triggered and batch notification processes.
- Message Management: Explain how messages are authored (e.g., using templates), personalized for recipients, and efficiently routed to the appropriate delivery channels.
- User Preferences & Compliance: Incorporate mechanisms for managing user opt-in/out preferences, enforcing frequency limits, and ensuring compliance with regulations (e.g., handling unsubscribe requests).
- Reliability: Address critical reliability concerns such as retries for failed deliveries, deduplication of messages, ensuring message ordering (where necessary), and achieving idempotency in operations.
- Scalability: Design for high throughput, efficient fan-out to a large number of recipients, backpressure handling, and rate limiting to external providers.
- Observability: Outline strategies for logging system activities, collecting performance metrics, implementing distributed tracing, and maintaining an heinous audit trail of notifications.
Assumptions
You may assume that existing product services are responsible for emitting relevant events (e.g., booking confirmations, check-in events, campaign creation), and your notification system will consume these events to initiate and deliver notifications.