PingHub is building a centralized notification service used by all product teams at a large tech company. Instead of each team building their own email/push/SMS integration, PingHub provides a single API:
`POST /notify { userId, channel, template, data }`
Core requirements:
- Multi-channel delivery - support push notifications (iOS/Android), email, SMS, and in-app (WebSocket). Each user has channel preferences (e.g., "send me emails but not SMS").•Template engine - notifications are rendered from templates with variable substitution ("Hi {{name}}, your order #{{orderId}} shipped!").•Delivery guarantees - at-least-once delivery with deduplication. Track delivery status (sent, delivered, opened, failed) per message.•Rate limiting & batching - don't spam users. Aggregate multiple notifications of the same type into a digest (e.g., "You have 5 new followers" instead of 5 separate notifications).•Priority levels - critical notifications (security alerts, OTP codes) bypass batching and are delivered immediately.•Observability - real-time dashboards showing delivery rates, failure rates, and latency per channel.
PingHub handles 100 million notifications per day across all channels.
Build a platform-wide notification service delivering 100 M messages/day across push, email, SMS, and in-app. Build this architecture under realistic production constraints, then validate tradeoffs in the design lab simulation.
Request path: The solution keeps ingress, service logic, and stateful dependencies separated so each layer can scale independently.
Reference flow: Web Clients -> Load Balancer -> API Gateway -> API Service -> Primary NoSQL DB -> Message Queue -> Background Workers -> Notification Fanout