The Real Fullstack

Design a Notification System

A campaign must reach 5 million users. What stops it from sending duplicates, ignoring opt-outs or getting your sender banned?

高级工程师12 分钟架构构建器
kafkaredispostgresqlpushemail

此挑战尚未翻译为简体中文,你正在阅读英文版本。

任务:Assemble a notification pipeline: asynchronous fan-out per channel, user preferences, deduplication, dead-lettering and provider rate limits — within a budget of 17.背景 · 学习目标 ▾

Brightcart's services emit business events (order shipped, price drop). Today the notification API calls the e-mail provider synchronously; during campaigns it times out, retries, and some customers receive the same e-mail three times. Push notifications are next.

任务: Assemble a notification pipeline: asynchronous fan-out per channel, user preferences, deduplication, dead-lettering and provider rate limits — within a budget of 17.

学习目标

  • Decouple producers from slow providers with a queue.
  • Fan out to channel-specific workers.
  • Combine at-least-once delivery with deduplication, DLQs and rate limits.
模拟模拟数据
Business events → Notification APINotification API → PreferencesNotification API → notifications topicNotification API → E-mail providernotifications topic → E-mail workersnotifications topic → Push workersE-mail workers → E-mail providerPush workers → Push providerE-mail workers → Dedupe storePush workers → Dedupe storeE-mail workers → DLQPush workers → DLQE-mail workers → Rate limiterBusiness eventsNotification APIPreferencesnotifications topicE-mail workersPush workersE-mail providerPush providerDedupe storeDLQRate limiter

选择组件和连接。键盘操作:使用示意图下方的列表。

运行模拟

运行模拟以查看输出。

简化说明

Structural checks only. Real systems also need templating, scheduling, quiet hours and bounce handling. 教学模型——数字用于说明行为,并非基准测试。

概念

建议先完成

相关挑战

参考资料