Posts tagged “queues”
-
How do you deliver webhooks so no event is ever lost?
Write every event to an outbox, retry with backoff and jitter for a day or more, sign each request with a timestamp, and let receivers replay what they missed. Receivers answer fast, deduplicate by event ID and never trust order. The design, and the quiet failure it prevents.
-
How do queues schedule millions of delayed retries?
"Retry this in 30 seconds", a million times over. A min-heap, a timing wheel, and a row in PostgreSQL with an index on its due time, measured: what each costs to add, cancel and fire, how late jobs run, and what survives a restart.
-
When should a write go through a queue instead of the API?
Queue the work behind a write when it's slow, unreliable or can finish after you answer; keep it synchronous when the caller needs the result. And never publish from the request itself: use an outbox.
-
How do you design a notification system?
One API that records the intent to notify, then a queue per channel (email, push, SMS, in-app) with its own retries and rate limits. User preferences, deduplication, quiet hours and digests sit before the queues; provider webhooks for bounces and complaints sit after them.