Design a scalable notification system that sends push notifications, emails, and SMS messages. The system handles millions of notifications per day with different priority levels. It needs template management, delivery tracking, per-user rate limiting, and retry logic for failed deliveries. The architecture should be decoupled so that adding new notification channels is easy.
Constraints
- Multiple notification channels must be supported simultaneously
- System should gracefully handle downstream service failures
- Rate limiting should prevent notification spam to individual users
Functional requirements
- Send notifications via multiple channels (push, email, SMS)
- Support notification templates and personalization
- Priority-based delivery (urgent vs. normal)
- Delivery tracking and status updates
- User notification preferences and opt-out
Non-functional requirements
- At-least-once delivery guarantee
- End-to-end latency < 30 seconds for high priority
- Handle 1M+ notifications per day
- Fault tolerant with retry mechanism
- Horizontally scalable