Case Study · Messaging · 2022 — 2023
Event-driven delivery that fans out to SMS and email asynchronously, with retries on failure.
Notifications were sent synchronously inside request handlers, so a slow SMS provider would stall the user's request, and a provider outage would silently drop messages. Critical alerts — OTPs, payment confirmations — were occasionally never delivered, with no record of why.
A high-throughput product sending OTPs, receipts, and alerts over both SMS (Arkesel) and email. Providers fail intermittently and rate-limit; delivery must survive that without blocking the user-facing request that triggered it.
Request path
App event
emit
Queue
BullMQ
Worker
consume
Provider
SMS / email
Delivery log
recorded
Failure recovery & consistency
Send fails
provider error
Backoff
exponential
Retry
n attempts
Dead letter
if exhausted
Producer
Worker
Channels
Chose
·Async queue-based delivery
·At-least-once with idempotent consumers
·Dead-letter queue over silent drops
Gave up
·Exactly-once delivery (chose simpler at-least-once)
·Instant synchronous confirmation to the caller
·Lower infra footprint (Redis + workers required)
0
user requests blocked by provider latency
100%
send attempts logged with outcome
↓
dropped critical messages via retry + DLQ