1. Multi-Channel Notification Complexity
Modern consumer apps deliver critical alerts across multiple channels: iOS APNs, Android FCM, SMS (Twilio), Email (SendGrid), and Webhooks. Alerts range from high-priority transactional 2FA codes (<2s SLA) to low-priority promotional campaigns.
2. Priority Queuing & Rate Limiting
Notifications are categorized into priority tiers: P0 (Emergency / 2FA verification), P1 (Account security / Order updates), P2 (Promotional marketing).
We use dedicated RabbitMQ or Kafka queues for each priority level. P0 consumers have dedicated worker pools that are never blocked by high-volume marketing batches. Per-user rate limiters prevent notification fatigue (e.g. max 3 marketing pushes per day).
3. User Preferences & De-Duplication Cache
Before dispatching any message, the Notification Router consults a Redis user preference cache to verify channel opt-ins and 'Do Not Disturb' time zones.
To prevent duplicate alerts during network retries, messages pass through a de-duplication filter hashing `userId + templateId + eventTimestamp`.
4. External Gateway Integration & Failure Handling
Third-party gateways (APNs, FCM) have strict rate quotas and experience outages. Workers implement circuit breakers and dead-letter queues (DLQs). If APNs returns device token invalid errors, workers publish cleanup events to purge stale tokens from database profiles.
Model this architecture on the HLDForge Canvas
Turn static box diagrams into living, collaborative systems. Drag and drop microservices, Kafka clusters, and cache tiers. Run automated SPOF detection and STRIDE threat modeling in real time.
Written by HLDForge Architecture Team
Staff Communications Architect
The HLDForge Architecture Team publishes practical engineering guides, real-world case studies, and high-concurrency blueprints to help engineers build scalable and fault-tolerant software.