Practice: Design Notification System
Multi-channel notifications platform that ingests events and delivers messages via email, SMS, push, and in-app with retries, preferences, and observability.
Build this system yourself on the canvas below. Add components, connect them, and run traffic simulations to see where your design holds up and where it breaks.
Functional requirements
- Ingest notification events via API and webhook with authentication and per-tenant quotas.
- Multi-channel delivery: email, SMS, push, and in-app; routing by preferences and channel availability.
- Templating with variables, locale support, and per-tenant overrides.
- Per-user preferences: opt-in/out per channel, quiet hours, and topic-level subscriptions.
- Idempotent send semantics using client or generated dedupe keys.
- Retries with exponential backoff; DLQ for poison messages and manual replays.
- Delivery status tracking: accepted, sent, delivered, opened/clicked, bounced/failed.
- Provider abstraction to switch email/SMS/push vendors without code changes.
- Scheduling (send-at) and priority queues for critical vs marketing traffic.
- Admin dashboards: templates, preferences, provider health, and analytics.
Non-functional requirements
- Availability: 99.95%+; single AZ failure must not drop ingest or delivery.
- Performance: ingest API p99 < 150 ms; enqueue-to-send median < 2 s; OTP send p95 < 1 s.
- Scalability: independently scale ingest, workers, and provider adapters; sustain bursty spikes.
- Durability: delivery logs and idempotency keys persisted with backups and retention policies.
- Consistency: strong for idempotency keys and preference updates; eventual for analytics aggregates (< 1 min).
- Security: TLS 1.2+; secrets in KMS; signed webhooks and provider callbacks; PII encrypted at rest.
- Resilience: timeouts/circuit breakers; retries with backoff and DLQ; circuit health-based provider failover.
- Observability: traces/logs/metrics for queue depth, send latency, success rates, and provider health.
- Cost: batch and aggregate analytics; tune retries and TTLs; multi-provider cost-based routing.