Notification Platform
Multi-tenant SaaS notification platform — templates, providers, orchestration, delivery receipts.
The scenario
Multi-tenant notification platform at Twilio/SendGrid scale — where provider fanout, quiet hours, and compliance converge
Same startup, same engineer #4. Fourteenth Monday.
Your CTO drops by. "Every product needs notifications. Password reset emails. SMS OTP. Push notifications for engagement. In-app for user activity. Time to build a proper notification platform — multi-tenant, multi-channel, compliance-ready. Ship an MVP in 12 weeks."
She pauses. "For context — SendGrid sends 148 BILLION emails per month. Twilio processes 260+ billion messages per year across SMS, WhatsApp, and voice. Braze delivers 3+ trillion messages per year. This isn't a simple send-email API. It's an orchestration platform with template management, delivery preferences, quiet hours, per-tenant rate limits, provider failover, GDPR/CCPA/TCPA compliance, and bidirectional delivery tracking. If we don't design for these upfront, we'll rebuild it three times."
Here's the paradigm shift:
Distributed Cache + Kafka were infrastructure primitives — you use them, you don't customize per user.
Notification Platform is customer-facing multi-tenant SaaS — every tenant has different templates, different rate limits, different compliance requirements, different providers. And critically:
- Send-then-forget doesn't work — 20-30% of emails bounce (bad addresses, spam filters), SMS providers rate-limit, push tokens expire. You must handle bidirectional flow (send → receipt → retry).
- Quiet hours matter more than throughput — sending a marketing email at 3am destroys open rates AND generates spam complaints AND triggers GDPR fines. Timezone-aware scheduling is not optional.
- Provider fanout is the reliability primitive — Twilio outages happen (2020: 3+ hour SMS outage). Multi-provider with automatic failover (Twilio → Vonage → Bandwidth) is table stakes.
- Templates are the product — Braze's competitive moat is Liquid template management + A/B testing + i18n, not the actual delivery.
SendGrid's answer was built for 148B emails/month scale with a distributed architecture: content storage in S3, template engines in dedicated services, SMTP-relay farm, deliverability team, IP reputation management. Reference: SendGrid engineering blog on scale. If you interview at SendGrid, Twilio, or any comms platform — understanding the deliverability + template + orchestration + compliance stack IS the interview.
The real 2024 numbers
- SendGrid: 148B emails/month (SendGrid Q4 2024 stats via Twilio SendGrid)
- Twilio: 260B+ messages/year across SMS, WhatsApp, voice (Twilio Q4 2024 earnings)
- Braze: 3+ trillion messages delivered/year, powering 2,000+ brands
- APNs push: ~50M pushes/sec sustained globally (Apple infra)
- FCM push: ~1M pushes/sec Google-side rate limit per project by default
- Email delivery: 20-30% bounce rate industry average — spam filters + bad addresses + honeypots
- TCPA fines: $500-1500 per unsolicited SMS in the US — compliance is not optional
- GDPR fines: up to €20M or 4% of annual revenue for unauthorized sends
Interview soundbite: "Notification Platform is 5 layers: (1) send API with idempotency-key + tenant isolation, (2) template engine with Liquid + i18n + A/B, (3) orchestration for channel fallback + rate limiting + quiet hours, (4) provider fanout with automatic failover + IP reputation management, (5) delivery receipt pipeline via Kafka to update user prefs + suppression lists. SendGrid does 148B/mo; Twilio does 260B/year. The bottleneck is never throughput — it's compliance + deliverability."
The whole journey at a glance
Every 10× in send volume forces different bottlenecks — starting with compliance:
text═══════════ NOTIFICATION PLATFORM ACROSS 4 SCALES ═══════════ L4 (10K/day) L5 (10M/day) L6 (1B/day) L7 (148B/mo SendGrid) Direct SendGrid Own SMTP + queue Multi-provider failover Full multi-tenant SaaS 12 weeks · $500/mo 6 months · $50K/mo 18 months · $2M/mo ongoing · $500M+/yr ┌────────┐ ┌────────┐ ┌── Tenant apps ─────┐ ┌── 10K+ tenants ──────┐ │ App │ │ App │ │ 100+ tenants │ │ isolated resources │ │ pods │ │ pods │ └─┬──┬──┬──┬─────────┘ └──┬──┬──┬──┬──────────┘ └───┬────┘ └───┬────┘ │ │ │ │ │ │ │ │ │ │ ┌─▼──▼──▼──▼─────┐ ┌───▼──▼──▼──▼──────────┐ ┌──▼───┐ ┌──▼──┐ │ Send API │ │ Multi-tenant Send API │ │Direct│ │Send │ │ + per-tenant │ │ + tenant-isolated │ │API │ │API +│ │ isolation │ │ rate limits │ │calls │ │queue│ │ + Idempotency │ │ + Idempotency-Key │ │to │ │+ SES│ └───┬──────┬─────┘ └──┬──┬──┬──┬──────────┘ │provdr│ │/APNs│ │ │ │ │ │ │ └──┬───┘ └──┬──┘ ┌───▼──────▼───┐ ┌──▼──▼──▼──▼──────────┐ │ │ │ Template svc │ │ Template svc │ │ │ │ + Liquid │ │ Liquid + i18n + A/B │ │ │ │ engine │ │ + campaign scheduler │ │ │ │ + i18n │ └──┬──┬──┬──┬──────────┘ │ │ └───┬───────────┘ │ │ │ │ │ │ ┌───▼──────────┐ ┌──▼──▼──▼──▼─────────┐ │ │ │Orchestration │ │ Orchestration layer │ │ ┌───▼──┐ │+ quiet hours │ │ + quiet hours (TZ) │ │ │Redis │ │+ rate limits │ │ + rate limits/tenant │ │ │queue │ │+ TZ-aware │ │ + channel fallback │ │ │(msg │ │ scheduling │ │ (email→SMS→push) │ │ │queue)│ └───┬──────┬───┘ │ + suppression lists │ │ └───┬──┘ ┌───▼──────▼──┐ └──┬──┬──┬──┬──────────┘ ┌──▼──────┐ ┌───▼─────────┐ │Provider │ │ │ │ │ │Kafka │ │Kafka + Flink│ │abstraction │ ┌────▼──▼──▼──▼─────────┐ │analytics│ │analytics │ │+ failover │ │Provider fanout │ │receipts │ │+ delivery │ │(SendGrid→ │ │+ multi-provider │ │(bounces │ │ receipts │ │ Mailgun→SES)│ │ failover per channel │ │etc) │ │+ Kafka to │ │+ IP repu │ │+ IP warm-up + reputat│ └─────────┘ │ update prefs│ │ mgmt │ │+ deliverability team │ └──────────────┘ └───┬──────────┘ └──┬───────────────────┘ │ │ ┌───▼──────────┐ ┌──▼───────────────────┐ │Bidirectional │ │Receipt pipeline │ │receipt loop │ │Kafka → Flink → update│ │(bounces, │ │user prefs + │ │opens, clicks,│ │suppression lists + │ │unsubs) │ │provider-selection ML │ └──────────────┘ └───────────────────────┘ Bottleneck Bottleneck Bottleneck Bottleneck Simple direct Provider quotas + Compliance surface Global multi-tenant send. No queue. quiet hour bugs. (GDPR/CCPA/TCPA) + + IP reputation + Provider outage Deliverability IP reputation mgmt + deliverability + = data loss. = bounces. per-tenant isolation. provider selection ML. Chapter 5 Chapters 6+6.5 Chapter 7+7.5 Chapter 8 walks walks through walks through provider walks through SendGrid through template svc + failover + IP reputation scale, IP warm-up, L4 MVP orchestration + compliance layers deliverability team, and per-tenant SaaS Key insight: Notification Platform is 5 layers, not 1. Send API + Template + Orchestration + Provider fanout + Receipt pipeline. Throughput is easy at any scale. The hard parts are: (1) COMPLIANCE (GDPR/TCPA fines are 6-7 figures), (2) DELIVERABILITY (30% bounce hurts sender reputation), (3) TENANT ISOLATION (one noisy neighbor destroys others' send rates). SendGrid, Twilio, Braze all invest heavily in these — not raw throughput.
The same 4 tiers as clean architecture diagrams
L4 · 10K sends/day · Direct SendGrid + MySQL · $500/mo · 12 weeks:
flowchart TD
W([App pods]) -->|SendGrid.send API| SG[SendGrid API]
W --> DB[(MySQL Multi-AZ<br/>users + templates + prefs)]
SG -.->|webhook: bounce, click| WH[SendGrid webhook<br/>updates prefs]
WH --> DB
classDef n fill:#dbeafe,stroke:#2563eb,color:#1e3a8a
class SG,DB,WH nL5 · 10M sends/day · Own queue + multi-channel · $50K/mo · 6 months:
flowchart TD
W([App pods]) -->|POST /send| API[Send API<br/>Idempotency-Key<br/>+ validate]
API --> Q[Redis/SQS queue<br/>bounded per-tenant]
Q --> ORCH[Orchestration workers<br/>rate limit + quiet hours<br/>channel selection]
ORCH --> EM[Email: SendGrid/SES]
ORCH --> SMS[SMS: Twilio]
ORCH --> PUSH[Push: FCM/APNs]
ORCH --> WEBHOOK[Webhook: HTTP POST]
EM -.->|webhook| KF[Kafka receipt pipeline]
SMS -.-> KF
PUSH -.-> KF
KF --> PREFS[(User prefs DB<br/>+ suppression lists)]
classDef n fill:#dbeafe,stroke:#2563eb,color:#1e3a8a
classDef m fill:#fef3c7,stroke:#d97706,color:#78350f
class API,Q,ORCH n
class EM,SMS,PUSH,WEBHOOK,KF,PREFS mL6 · 1B sends/day · Multi-tenant + provider failover · $2M/mo · 18 months:
flowchart TD
W([100+ tenants]) -->|per-tenant API key| API[Send API<br/>tenant-isolated rate limits<br/>+ Idempotency-Key]
API --> Q[Per-tenant Kafka partitions<br/>noisy-neighbor isolation]
Q --> TMPL[Template svc<br/>Liquid + i18n + A/B]
TMPL --> ORCH[Orchestration<br/>+ TZ-aware quiet hours<br/>+ channel fallback<br/>+ suppression lookup]
ORCH --> PRV[Provider abstraction<br/>SendGrid → Mailgun → SES failover<br/>+ IP reputation weighting]
PRV --> KF[Kafka receipt pipeline<br/>Flink processors]
KF --> ML[ML models<br/>provider selection<br/>send-time optimization]
KF --> PREFS[(User prefs + suppression lists)]
classDef n fill:#dbeafe,stroke:#2563eb,color:#1e3a8a
classDef m fill:#fef3c7,stroke:#d97706,color:#78350f
classDef ml fill:#dcfce7,stroke:#16a34a,color:#14532d
class API,Q n
class TMPL,ORCH,PRV,KF,PREFS m
class ML mlL7 · 148B emails/mo SendGrid scale · Full SaaS · $500M+/yr:
flowchart TD
W([10K+ tenants]) -->|per-tenant API| API[Multi-tenant Send API<br/>+ Idempotency-Key + validation]
API --> Q[Kafka per-tenant partitions<br/>isolation + fairness]
Q --> TMPL[Template svc<br/>Liquid + i18n + A/B<br/>+ campaign scheduler]
TMPL --> ORCH[Orchestration layer<br/>+ TZ-aware quiet hours<br/>+ rate limits/tenant<br/>+ channel fallback<br/>+ suppression + preference center]
ORCH --> PROV[Provider fanout<br/>+ multi-provider failover per channel<br/>+ IP warm-up + reputation mgmt<br/>+ deliverability team monitoring]
PROV --> RCPT[Receipt pipeline<br/>Kafka → Flink → user prefs<br/>+ suppression + provider-selection ML]
RCPT --> DB[(Kafka + Iceberg data lake<br/>compliance audit trail)]
classDef n fill:#dbeafe,stroke:#2563eb,color:#1e3a8a
classDef m fill:#fef3c7,stroke:#d97706,color:#78350f
classDef ml fill:#dcfce7,stroke:#16a34a,color:#14532d
class API,Q n
class TMPL,ORCH,PROV,DB m
class RCPT mlWhy every 10× breaks the architecture
- Compliance is the FIRST-CLASS design constraint. L4 = trust SendGrid to handle compliance. L5+ = you must build tenant-configurable suppression lists, quiet hours (timezone-aware), unsubscribe preferences, opt-in gates, GDPR data residency. TCPA fines are $500-1500 per unsolicited SMS. Reference: TCPA regulations FCC.
- Provider failover is the reliability primitive. Twilio's 2020 3-hour SMS outage cost customers $100M+ in lost revenue. Multi-provider with automatic failover (Twilio → Vonage → Bandwidth for SMS; SendGrid → Mailgun → SES for email; APNs + FCM + WebPush for push) is table stakes. Reference: Twilio 2020 outage postmortem.
- IP reputation is the L6+ deliverability lever. Every sender IP has a "reputation" tracked by Gmail/Outlook/Yahoo. Sending too much too fast on a cold IP = spam folder. Solution: IP warm-up (send from cold IP in gradually-increasing volumes over 4-8 weeks). SendGrid's competitive moat = they manage 1000s of IPs with automatic warm-up. Reference: SendGrid IP warm-up guide.
The 3 senior insights before we start Chapter 1
- Notification Platform is 5 layers, not 1. Send API + Template engine + Orchestration + Provider fanout + Receipt pipeline. Every candidate mentions "send API"; L6+ candidates mention all 5. Reference: Braze architecture overview.
- Deliverability (not throughput) is the bottleneck. 30% email bounce rate is industry-average — a bad list destroys your sender reputation across ALL your customers. This is why SendGrid has a full "deliverability team" (not just infra). Naming this signals platform-vendor awareness.
- Quiet hours + timezone-aware scheduling is the compliance L5 probe. Sending marketing at 3am generates spam complaints + violates jurisdiction-specific do-not-call rules. If you don't mention timezone-aware quiet hours, you'll fail the compliance signal. Reference: CAN-SPAM Act.
Chapter map for the journey ahead
- Chapter 1 — Requirements (send, template, prefs, tracking, compliance)
- Chapter 2 — Capacity estimation (148B SendGrid ref, 260B Twilio)
- Chapter 3 — API design (send, template CRUD, prefs, delivery status)
- Chapter 4 — Data model (tenants, templates, prefs, suppression, receipts)
- Chapter 4.5 — Template engine deep-dive: Liquid + i18n + A/B testing
- Chapter 5 — L4 MVP: Direct SendGrid + MySQL. Works to 10K/day
- Chapter 6 — L5: Own queue + multi-channel + Kafka receipt pipeline
- Chapter 6.5 — Orchestration layer: quiet hours + channel fallback
- Chapter 7 — L6: Multi-tenant isolation + provider failover + IP reputation
- Chapter 7.5 — Deliverability deep-dive: IP warm-up + sender reputation
- Chapter 8 — L7: SendGrid-scale + deliverability team + full SaaS
- Chapter 9 — Failure modes: provider outage, quiet-hour bug, tenant abuse, compliance breach
- Chapter 10 — Trade-off matrix (SendGrid vs Twilio vs Braze vs Airship vs Iterable)
- Chapter 11 — Interview masterclass: 45-min mock, questions to ask
- Chapter 12 — Defense: the 20 hardest interview questions on notification platforms
Ready? Chapter 1 next: what did the CTO actually ask for?
Notification Platform is 5 layers: (1) send API with idempotency-key + tenant isolation, (2) template engine with Liquid + i18n + A/B, (3) orchestration for channel fallback + rate limiting + timezone-aware quiet hours, (4) provider fanout with automatic failover + IP reputation management, (5) delivery receipt pipeline via Kafka to update prefs + suppression lists. SendGrid does 148B emails/month; Twilio does 260B messages/year. The bottleneck is never throughput — it's compliance (TCPA/GDPR) + deliverability (30% bounce industry average) + tenant isolation (one noisy neighbor destroys others' send rates).
- Why is Notification Platform 5 layers, not 1?
- What are TCPA/GDPR fines and why do they force compliance-first design?
- What is IP warm-up and why does SendGrid have a full deliverability team?
- Why is provider failover (Twilio → Vonage → Bandwidth) the reliability primitive?
- What are timezone-aware quiet hours and why do they matter for compliance?
Every concept below has its own interactive, animated page in the Learning Tracks section. Read them any time you want to go deeper than the mentor prose above — they're the reusable foundation this chapter is built on.
Kafka is the receipt-pipeline transport — every bounce, open, click flows through Kafka to update user prefs + suppression lists + provider-selection ML.
Suppression list updates must invalidate template-rendering caches instantly — sending to an unsubscribed user = TCPA fine.
Chapter 1 next: what did the CTO actually ask for? Send, templates, preferences, tracking, compliance — each has functional and non-functional requirements. Get these wrong and you'll design the wrong system for the whole 12 chapters.