System Design: Push Notifications and In‑App Messaging Platform
Context
Design a notifications platform for a large consumer mobile app with millions of daily active users. The platform must support both push notifications (iOS/Android) and in‑app messaging, with rich targeting, personalization, and compliance.
Functional Requirements
-
User preferences and consent
-
Channels: push, in‑app (future‑proof for email/SMS)
-
Topics/categories, frequency caps
-
Quiet hours and time zone handling
-
Segmentation and targeting
-
Dynamic segments, real‑time triggers, and scheduled campaigns
-
Deduplication
-
Across retries and overlapping campaigns; vendor collapse keys
-
Rate limiting and throttling
-
Per user, per campaign, and global/vendor limits
-
Retries, backoff, and idempotency
-
Scheduling and batching
-
Future send times and batching for efficiency
-
A/B experiments
-
Randomized assignment, holdouts, metrics
-
Localization
-
Templates, placeholders, pluralization, fallbacks
-
In‑app messaging
-
Message inbox, triggers, display rules, and impression tracking
System Requirements
-
Describe APIs, data model, event pipeline, delivery workers
-
Integrate with APNs (iOS) and FCM (Android)
-
Scale to millions of DAUs and bursty traffic
-
Multi‑region deployment and CAP trade‑offs
-
Monitoring, alerting, and SLOs
-
GDPR/CCPA compliance
-
Failure handling and graceful degradation
-
Capacity estimates and a safe rollout plan