- Webhooks are asynchronous notifications your customers rely on to react to events.
- A resilient webhook system must avoid data loss, prevent one customer from degrading global throughput, and provide operational tools for failed deliveries.
200 OK. This couples the request lifecycle to external availability and can lose events when timeouts occur or downstream systems are down.

- Blocked request handlers and degraded request throughput.
- No durability: timeouts can cause permanent event loss.
- No retries, observability, or isolation.
- Immediate durability: the originating request returns quickly.
- Decouples delivery from event production for better latency and reliability.

- Prevent one slow or failing customer from consuming global worker capacity.
- Apply per-customer rate limits and concurrency caps.
- Fair scheduling across customers.
- Dispatcher reads pending outbox entries and uses a token-bucket or semaphore per
customer_id. - Use lightweight in-memory counters (with persistence for recovery) or a distributed store (Redis) for cross-instance coordination.

- Timeout per request:
10s - Retry on: network timeouts, DNS errors, HTTP 5xx
- Backoff strategy: exponential backoff with jitter (e.g., 1s, 2s, 4s, 8s)
- Max attempts:
3–6depending on SLA and system load - On 4xx (e.g.,
404,410): do not retry; move to DLQ

- Search and filter by
customer_id, event type, date, and error code. - Show failure reason, response body, and headers received from customer.
- Allow single or bulk replay with optional metadata (e.g., “force send with debug”).
- Audit trail for replay attempts.
- Move failed events to DLQ with metadata (error code, attempts, last_response).
- Support engineers or customers investigate and manually re-queue or replay events.

X-Signature).
Signing webhooks (for example, using an HMAC with a shared secret and including the signature in a header) helps customers verify authenticity and detect tampering.

- Backend: write each event to a transactional outbox as part of the originating transaction so events are durable immediately.
- Dispatcher: poll or stream pending outbox entries and enforce per-customer concurrency and rate limits, ensuring fair scheduling across customers.
- Worker pool: workers pick up dispatched jobs, sign payloads, POST to customer endpoints with a short timeout, and implement retry logic with exponential backoff for transient failures.
- Dead letter queue + Replay UI: after retry exhaustion, move failed events into a DLQ and surface them in a replay dashboard for manual investigation and retransmission.
- Security: sign every webhook payload (e.g., HMAC) so customers can verify authenticity.
Common operational considerations
- Idempotency: include a unique
idin the webhook to allow safe retries and avoid duplicate processing by the customer. - Observability: emit metrics for delivery latency, success rate, retries, DLQ rate, and per-customer throughput.
- Rate limits: optionally respect customer-specified rate limits (requests/sec) in addition to concurrency caps.
- Back-pressure: when DLQ/backlog grows, reduce generator rate or apply customer throttling to preserve system stability.
- Secrets management: rotate signing keys, and provide customers metadata (key id) so they can validate signatures after rotation.
Links and references
- Kubernetes Documentation — run scalable worker pools.
- HMAC signing guidance — search for “HMAC SHA256 webhook signing” for implementation details.
- Exponential backoff best practices — aim for randomized jitter to avoid thundering herds.