Skip to content

Design a Notification System, stage 8 of 11: change it

The announcement and the security alert

Same provider, same account, same 500/s.

System so far· 10 parts
123456789SERVICEProduct servicesLOG / STREAMEvent streamWORKERNotificationplannerDATABASENotifications DBQUEUEDelivery queuesWORKERChannel sendersEXTERNALEmail providerEXTERNALPush servicesSERVICEInbox APICLIENTWeb andmobile apps

Select a component to see what it is responsible for and which state it owns.

  1. 1Product services → Event stream: Domain events via outbox
  2. 2Event stream → Notification planner: Events, at least once
  3. 3Notification planner → Notifications DB: Insert notifications under dedupe keys
  4. 4Notification planner → Delivery queues: Deliveries by priority class
  5. 5Channel senders → Delivery queues: Claim deliveries
  6. 6Channel senders → Email provider: Send within quota
  7. 7Channel senders → Push services: Send to each device
  8. 8Web and mobile apps → Inbox API: Inbox and read state
  9. 9Inbox API → Notifications DB: Read notifications
  • Asynchronous
  • Request / response

What you need to know

0 of 2 checks done
  1. Two different problems hide behind "urgent messages wait":

    • Order: urgent work is behind other work in the same queue. Priorities or separate queues fix this.
    • Capacity: even at the front of the queue, there is no capacity left to serve it. Only reserving capacity fixes this.

    Here the capacity is the provider's 500 emails a second for the whole account.

  2. Check

    Alerts get the highest priority in a shared queue, but bulk senders have already used this second's 500 sends. When does the alert go out?