Designing Notification Systems

1. Designing Email Notification Architecture

ElementDetail
ProviderSES, SendGrid, Postmark, Mailgun
AuthSPF + DKIM + DMARC mandatory
TemplatingMJML, Handlebars; preview tooling
ReputationWarm IP; dedicated for transactional
Bounce handlingSuppression list; auto-remove hard bounces

2. Designing Push Notification Architecture

ElementDetail
ProvidersFCM (Android/Web), APNs (iOS)
Token mgmtRegister/refresh/expire device tokens
Topics / segmentsBroadcast efficiently
Payload limits~4KB; deep-link IDs only
Silent pushBackground data sync

3. Designing SMS Notification Architecture

ElementDetail
ProvidersTwilio, MessageBird, AWS SNS
NumbersLong codes, short codes, alphanumeric sender
Compliance10DLC (US), TCPA, GDPR consent
Cost controlPer-country pricing varies wildly
Fallback chainSMS → voice / WhatsApp

4. Designing In-App Notification System

ElementDetail
StorageDB per-user inbox table
Read stateper-user-per-notification
Real-timeWS/SSE for live badge
PaginationCursor-based
RetentionAuto-archive after N days

5. Designing Notification Preference Management

SettingDetail
Channel togglePer-channel opt-in
CategoryMarketing / transactional / security
FrequencyReal-time / digest / off
Quiet hoursRespect user TZ
Unsubscribe linkOne-click; legal requirement

6. Designing Notification Queuing

AspectDetail
Per-channel queueIndependent throughput
PriorityCritical (security) ≫ marketing
Scheduled deliveryDelayed queue / cron
Batch sendBulk APIs to provider

7. Designing Delivery Status Tracking

StatusSource
queuedInternal
sentProvider accepted
deliveredProvider webhook
opened / clickedTracking pixel / link wrap
bounced / failedWebhook + reason

8. Designing Notification Templates

AspectDetail
VersionedRoll back if render bug
LocalizationPer-locale variants
VariablesValidated to prevent broken renders
PreviewSample data render in CI
A/B testSubject lines / body

9. Designing Notification Aggregation

StrategyDetail
DigestHourly/daily summary
Coalescing"5 new comments" not 5 messages
Throttle windowMax N per hour per user
Smart timingSend when user typically active

10. Designing Notification Rate Limiting

LayerDetail
Per-user capPrevent fatigue
Per-channel capProvider quota
Per-categoryMarketing limited harder
Global throttleSmooth provider load

11. Designing Notification Retry Strategy

ActionDetail
Exponential backoffFor transient provider errors
DLQAfter max attempts
Don't retryHard bounce / unsubscribed
Channel fallbackSMS fails → push → email

12. Designing Multi-Channel Notification

PatternDetail
Channel orchestratorOne API → routes to channels
Routing rulesPer category / priority / preference
IdempotencyDedupe by event_id across channels
ToolsKnock, Courier, Novu, OneSignal