System Design: Event Email Notification at Scale
Context
You are building a platform that hosts many events. Each event can have many participants (attendees) who have opted in to receive email notifications (e.g., reminders, schedule changes, cancellations). The system must support up to 1,000,000 events and reliably send notification emails to the participants of each event.
Requirements
Design an email notification system that can handle this scale. Address the following:
-
Architecture
-
High-level components and data flow from event change to email delivery.
-
Scalability
-
How the system scales to 1M events and high recipient volumes; partitioning, throughput, and backpressure.
-
Data Storage
-
Core schemas/entities, storage choices (SQL/NoSQL/cache), and indexing for efficient fan-out.
-
Email Distribution
-
Template management, personalization, batching, and integration with an Email Service Provider (ESP).
-
Failure Handling and Reliability
-
Retries, idempotency, dead-letter queues, monitoring/alerting, and handling bounces/complaints/unsubscribes.
-
Cost Considerations
-
Key cost drivers (compute, storage, ESP), ballpark estimates, and cost-optimization strategies.
State reasonable assumptions (e.g., average participants per event, delivery-time SLO), and justify trade-offs.