System Design: Scalable Event Management and Email Notification Pipeline
Context
Design a production-ready system to manage events and notify all registered participants by email. The platform must support at least 1,000,000 events and scale horizontally. Assume multiple services, multi-tenant usage, and a mix of small and very large events.
Requirements
-
Functional
-
Create and update events.
-
Register and unregister participants to events.
-
Trigger notifications per event (e.g., event updates, reminders) and send emails to all registered participants.
-
Respect unsubscribe preferences; handle bounces and complaints to maintain a suppression list.
-
Non-functional
-
Scale to ≥ 1,000,000 events and high fan-out notifications.
-
High throughput email pipeline with batching, prioritization, rate limiting, and retries.
-
Idempotency and deduplication across API, queue, and sender. Clear delivery semantics.
-
Horizontal scaling, partitioning/sharding strategy.
-
Strong observability, failure handling, disaster recovery, and cost awareness.
Deliverables
-
APIs: create/update event, register/unregister participant, trigger/send notifications.
-
Data models and storage choices.
-
Email job enqueueing, batching, prioritization strategy.
-
Scale assumptions and estimates: participants per event, peak QPS, daily email volume.
-
Rate limiting and exponential backoff to meet provider quotas.
-
Idempotency, deduplication, retry, bounce/complaint handling, unsubscribe preferences.
-
Architecture: services, queues/streams, databases, caches, partitioning, horizontal scaling.
-
Consistency requirements and delivery semantics (at-least-once vs exactly-once).
-
Observability: metrics, tracing, alerting.
-
Failure scenarios, disaster recovery, and cost considerations.