Designing Notification Systems
1. Designing Email Notification Architecture
| Element | Detail |
|---|---|
| Provider | SES, SendGrid, Postmark, Mailgun |
| Auth | SPF + DKIM + DMARC mandatory |
| Templating | MJML, Handlebars; preview tooling |
| Reputation | Warm IP; dedicated for transactional |
| Bounce handling | Suppression list; auto-remove hard bounces |
2. Designing Push Notification Architecture
| Element | Detail |
|---|---|
| Providers | FCM (Android/Web), APNs (iOS) |
| Token mgmt | Register/refresh/expire device tokens |
| Topics / segments | Broadcast efficiently |
| Payload limits | ~4KB; deep-link IDs only |
| Silent push | Background data sync |
3. Designing SMS Notification Architecture
| Element | Detail |
|---|---|
| Providers | Twilio, MessageBird, AWS SNS |
| Numbers | Long codes, short codes, alphanumeric sender |
| Compliance | 10DLC (US), TCPA, GDPR consent |
| Cost control | Per-country pricing varies wildly |
| Fallback chain | SMS → voice / WhatsApp |
4. Designing In-App Notification System
| Element | Detail |
|---|---|
| Storage | DB per-user inbox table |
| Read state | per-user-per-notification |
| Real-time | WS/SSE for live badge |
| Pagination | Cursor-based |
| Retention | Auto-archive after N days |
5. Designing Notification Preference Management
| Setting | Detail |
|---|---|
| Channel toggle | Per-channel opt-in |
| Category | Marketing / transactional / security |
| Frequency | Real-time / digest / off |
| Quiet hours | Respect user TZ |
| Unsubscribe link | One-click; legal requirement |
6. Designing Notification Queuing
| Aspect | Detail |
|---|---|
| Per-channel queue | Independent throughput |
| Priority | Critical (security) ≫ marketing |
| Scheduled delivery | Delayed queue / cron |
| Batch send | Bulk APIs to provider |
7. Designing Delivery Status Tracking
| Status | Source |
|---|---|
| queued | Internal |
| sent | Provider accepted |
| delivered | Provider webhook |
| opened / clicked | Tracking pixel / link wrap |
| bounced / failed | Webhook + reason |
8. Designing Notification Templates
| Aspect | Detail |
|---|---|
| Versioned | Roll back if render bug |
| Localization | Per-locale variants |
| Variables | Validated to prevent broken renders |
| Preview | Sample data render in CI |
| A/B test | Subject lines / body |
9. Designing Notification Aggregation
| Strategy | Detail |
|---|---|
| Digest | Hourly/daily summary |
| Coalescing | "5 new comments" not 5 messages |
| Throttle window | Max N per hour per user |
| Smart timing | Send when user typically active |
10. Designing Notification Rate Limiting
| Layer | Detail |
|---|---|
| Per-user cap | Prevent fatigue |
| Per-channel cap | Provider quota |
| Per-category | Marketing limited harder |
| Global throttle | Smooth provider load |
11. Designing Notification Retry Strategy
| Action | Detail |
|---|---|
| Exponential backoff | For transient provider errors |
| DLQ | After max attempts |
| Don't retry | Hard bounce / unsubscribed |
| Channel fallback | SMS fails → push → email |
12. Designing Multi-Channel Notification
| Pattern | Detail |
|---|---|
| Channel orchestrator | One API → routes to channels |
| Routing rules | Per category / priority / preference |
| Idempotency | Dedupe by event_id across channels |
| Tools | Knock, Courier, Novu, OneSignal |