Design a Programmable SMS / Messaging Delivery System

Problem

Design Twilio's programmable messaging backend that sends and tracks billions of SMS/messages via carriers.

Requirements

Functional:

  • Send messages via multiple carrier routes
  • Track delivery receipts (DLRs)
  • Retry/fallback on carrier failure
  • Webhooks to customers on status change

Non-functional:

  • Billions of messages/day
  • Multi-region failover
  • Exactly-once-ish delivery semantics

Discussion points

  1. Carrier routing and least-cost routing
  2. Async pipeline (queue + workers)
  3. Idempotency and dedup
  4. Outbox pattern for reliable webhooks
  5. Multi-region failover and back-pressure
added …
LeaderboardSalaryAccount