Notification Service 00:00:01 An order ships and the phone should know A parcel leaves the warehouse. One design lets the order service describe the event while a notification service decides the recipient, channel and delivery timing. Follow the shipment message from intent to a real provider outcome. The order service names a user, a template and some data. it does not need to know about push or email. Push is on. The time zone comes back too. this read happens for every message. In the example weighted scheduling gives urgent work a larger share while leaving some worker time for lower-priority messages. A status event goes back to the log, then to Cassandra and ClickHouse. writing history must not slow delivery. Store the logical notification identity before delivery. A successful provider submission and the customer seeing the alert are different milestones, each with its own available evidence. 00:00:51 A sign-in code has an expiry clock Five minutes changes everything for a sign-in code. A delayed advertisement may still have value tomorrow. A stale login code can frustrate a customer even when the email provider reports success. Template otp_login, deadline in 5 minutes. Render the subject and message through the appropriate template. Keep the code out of routine logs and analytics. From the sending pool used only for codes and receipts. marketing complaints do not harm its reputation. The log and the totals learn about it. Use the correct recipient, mask sensitive values in operational logs, and drop work whose useful deadline has passed. Distinguish provider acceptance from delivery and successful sign-in. 00:01:33 Protect one lane from another A marketing campaign arrives while shoppers are signing in. A single unconstrained worker pool lets low-priority volume consume the resource needed by the time-sensitive requests. It names a template. The template carries the priority. Codes, security alerts, password resets. Target under 5 seconds. Promotions and newsletters. Best effort, in batches. A slow advert can fill the shared pool. It cannot touch the reserved one. Reserve capacity for the urgent lane and define promotion or fairness rules for the rest. Test the scheduler at peak load, when the configured priority actually has consequences. 00:02:11 Retry only while delivery is still useful Two messages encounter a transient provider error. Backoff, random delay and a finite attempt budget can help, but only one has hours to wait. A few seconds apart, with chance added. Both messages fail with 503. The example sign-in code expires after five minutes. A later scheduled retry cannot make it valid again. Another failure. The breaker has been open for a while. It is kept for a person to look at and replay. An alarm watches how many wait there. Record why an item stopped, and route unresolved eligible failures for investigation. Replaying a dead-letter record after repair must still respect expiry, consent and deduplication. 00:02:51 A second provider has a smaller quota The preferred email provider begins returning errors. Opening a circuit gives it time to recover. Switching every pending message immediately could overwhelm the backup provider too. Half of the calls to provider A fail. No more calls to A. Critical and high go to B, which is kept warm with a little traffic every day. Marketing stays in the queue, because B has a smaller quota. A few messages test A. They succeed, and traffic returns step by step. Fail over according to priority and sustainable capacity, then probe the original route before increasing traffic. A good delivery system protects the customer's intent across repeated, late and unavailable attempts.