Xây một service mà mọi team gọi với một loại thông báo + người nhận, để service tự quyết định channel, template, tuỳ chọn người dùng và độ ưu tiên. Nước đi thiết kế then chốt là priority lane — một OTP không thể chờ sau một đợt marketing 2 triệu user.
Kiến trúc
Services ─▶ Notify API ─▶ [validate + enrich] ─▶ Kafka topics
├─ otp/txn (high lane)
└─ marketing (bulk lane)
│
┌──── Dispatcher (per lane) ────┐
│ prefs check ─▶ template render │
└────┬──────┬──────┬────────────┘
Push Email SMS In-App
(provider adapters + rate limit)
