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. 教育用モデルです。数値は挙動を示すためのもので、ベンチマークではありません。

コンセプト

先に取り組むと役立つ課題

関連する課題

参考資料