Question #27 of 60•Protocols•Hard• ~3 min read

How do you design a High-Throughput Push Notification Service?

Executive Takeaway

Deconstruct message queuing, APNs/FCM provider rate limits, user device mapping, and prioritization pipelines for notifications.

Architectural Breakdown & AnalysisFAANG Aligned

Building a system to push millions of mobile/web notifications per minute requires decoupled asynchronous processing pipelines.

Architecture Flow

  1. API Ingestion: Accepts notification triggers, assigns priority queues (Transactional vs. Promotional).
  2. User Device Registry: Resolves user IDs to device tokens (iOS APNs / Android FCM tokens) using a partitioned DB.
  3. Message Fan-Out Queue (Kafka): Pushes message payloads to Kafka topic partitions distributed by device token hash.
  4. Worker Clusters: Async workers batch requests to Apple APNs and Google FCM HTTP/2 push endpoints.
NOTE — Idempotency & De-duplication

Assign a unique notification_id to prevent duplicate pushes if notification workers retry failed APNs/FCM connections.

Key Architectural Comparison

Push ChannelProtocolLatency SLACost per MessageDelivery Reliability
Apple APNs / Google FCMHTTP/2 Persistent Stream$< 500\text{ms}$FreeBest-effort (Requires device connection).
SMS (Twilio / Sinch)Telephony SS7 / SMPP2–5 secondsHigh ($0.01–$0.05/msg)High (Guaranteed delivery network).
Email (SendGrid / SES)SMTP over TLS5–60 secondsVery Low ($0.10/1k msgs)Subject to spam folder filters.
Previous QuestionWhen should you choose gRPC / Protobuf over REST and GraphQL for microservices?Next Question How do S3 and HDFS store petabytes of unstructured blob data reliably?

Continue Learning on Being SDE

Explore deep-dive system architecture modules, low-level object-oriented designs, and interview cheat sheets.