Part 10 · Blueprint 65
Distributed Webhooks & Event Delivery Platform
15 min reading · Sources · Editorial review pending
One slow customer endpoint must not occupy every worker or be mistaken for failed acceptance.
Page details
Published date · Last edited:
Draft edition. Editorial review and supplementary reading recommendations are still being completed.
Format: Architecture walkthrough. Prerequisites: the beginner bootcamp. Chapter prerequisites: Message Queues & Event Streams: Kafka vs. RabbitMQ, Idempotency Keys & Distributed Retries, Security Architecture, Zero-Trust & Multi-Tenancy.
Sixty-second mental model
Problem: One slow customer endpoint must not occupy every worker or be mistaken for failed acceptance.
Use: Isolate endpoints, authenticate payloads and reconcile ambiguous delivery.
Design boundary: Deliver durable events to untrusted external endpoints with retry, expiry and tenant isolation. Endpoint acknowledgement is not proof of its downstream business effect.
Layer 1 · Intuition
Hypothetical scenario: Northwind is designing outbound webhooks. Maya represents product requirements, Dev implementation and Priya reliability. The team must agree what one webhook attempt means and which component owns the event and delivery attempt records.
Think of a courier delivering signed notices to unreliable destinations. Separate the requester from event and delivery attempt records, then identify the retained evidence needed after failure.
- Authority
- The entitled state owner.
- Invariant
- A rule preserved across concurrency and failures.
Architecture and worked reasoning
Design boundary: Deliver durable events to untrusted external endpoints with retry, expiry and tenant isolation. Endpoint acknowledgement is not proof of its downstream business effect.
Responsibilities on the request path
Workload and limiting resource
Hypothetical 1,000 events/s with five subscribed endpoints/event create 5,000 obligations/s. If 10% require one retry, attempt rate becomes 5,500/s under that chosen mix. One stalled endpoint must not consume the entire shared pool.
Keep the units attached to each intermediate result. The assumptions above describe a hypothetical exercise, not observed vendor capacity. A real capacity decision also needs a measured service curve, skew, recovery traffic and an explicit admission policy for overload.
Mutation or publication path
- Record an event and subscribed endpoint obligations.
- Validate each destination and prepare a signed versioned payload.
- Attempt under per-endpoint concurrency, timeout and retention policy.
Observation and recovery path
- Expose attempts and the strongest receipt evidence.
- Retry the same delivery identity with bounded backoff.
- Support replay without silently changing original event meaning.
Failure that changes the decision
Hypothetical scenario: A registered URL redirects into a private network. Revalidate destinations and redirect policy; signing the payload does not prevent server-side request forgery.
Attempt this decision before reading the explanation
Can all successful HTTP responses be interpreted as the customer completing its business action?
No. They show the documented acknowledgement boundary. Preserve delivery identity and let the consumer implement its own effect/reconciliation contract.
Supporting mechanism analysis
Hypothetical scenario: Northwind. Maya represents product, Dev implementation and Priya reliability. The following workflow develops the underlying mechanism.
Hypothetical scenario. Northwind’s worker updates search, then loses its connection before acknowledging the item. A replacement receives the same delivery. Dev suggests acknowledging first next time; Priya places a worker crash immediately after that early acknowledgement.
Trace both crash windows against the obligation from page 19. Separate publisher confirmation, consumer acknowledgement and the external search effect. Count logical work and attempts separately so recovery does not look like unexplained extra demand.
It changes which risk you expose: a crash after acknowledgement can leave work unfinished without broker redelivery. Protect the obligation, not just the visible duplicate count.
This reveals what must be repeatable, discoverable or reconciled. The protocol needs an answer for uncertain completion as well as a policy for redelivery.
A publisher confirmation concerns a producer’s interaction with a broker under the selected publication contract. A consumer acknowledgement tells the broker how to treat an item delivered to a consumer. Neither alone proves that Northwind’s external search projection changed correctly.
RabbitMQ’s acknowledgement and confirmation guide documents these distinct mechanisms. Identify which signal the application records at each stage. A healthy publisher connection, a retained message and a finished business effect are three different facts.
The product response still promises a stored edit and its durable processing intent. Search readiness is tracked separately. A broker can do exactly what its configuration requests while an application acknowledges too early or loses the connection between delivery identity and the intended update.
If a worker acknowledges before applying the effect, then crashes, the broker may consider the delivery complete even though the projection remains old. If it applies the effect before acknowledging, then crashes, delivery can recur even though the projection already changed. Moving the acknowledgement exchanges one gap for another.
A recoverable design makes repeated delivery safe under the operation’s meaning. For a full product-search representation, a logical identity can combine product identity, source version and projection schema version. Repeating that same operation means trying to establish the same intended representation, not creating another product edit.
For a target transaction entirely inside one database, an inbox identity and the business update can commit together. A separate inbox flag written before an external HTTP effect is insufficient: a crash can leave the flag without the effect. Writing it afterward leaves the opposite ambiguity. Remote success with a lost response requires the remote service's operation identity and lookup or reconciliation contract.
Kafka transactions can bind selected log writes and offsets under their documented scope. They do not turn an unrelated payment provider or search API into the same transaction. Keep poison-work quarantine as an unfinished or deliberately rejected obligation with reason and owner. A broker queue reaching zero does not prove every accepted logical job completed.
An in-memory “seen” set disappears with its process and does not coordinate several workers. A separate durable seen record also needs careful placement. Recording seen before the effect can lose work; recording it afterward can leave a duplicate-effect window if the two operations do not share an atomic boundary.
Where the effect is in the same database, the application can seek a local transaction that binds the relevant state and operation identity. Where the effect is external, require a supported conditional operation or an identity/status contract at that service. A local flag cannot retroactively make an external call atomic.
For this hypothetical projection design, require the target to reject an older source version from overwriting a newer complete representation. If version 9 is already applied, a delayed full version 8 should not replace it. This is a required target contract to establish, not an assertion that every indexing API implements it automatically.
Full snapshots and deltas have different rules. Replacing a representation with a newer complete snapshot may supersede an older snapshot. Skipping an increment or a required intermediate action may change the result. Define the operation before selecting a deduplication or version comparison strategy.
Hypothetical worked example. Choose twenty logical search-update jobs. Sixteen complete on the first attempt, three on their second and one on its third. Attempts total 16 × 1 + 3 × 2 + 1 × 3 = 25. Additional attempts are 25 − 20 = 5, while successful logical effects remain twenty under the declared protection contract.
Now introduce a separate measured quantity the design would need: attempt-processing capacity. For the exercise, choose three attempts per second, with the same selected 1.25-attempt mix. Logical completion capacity is 3 ÷ 1.25 = 2.4 jobs per second. Net recovery margin against two incoming jobs is 2.4 − 2 = 0.4 per second.
Retry transient failures under an explicit delay, attempt and age policy. Repeated immediate retries can consume capacity needed for useful work. A permanently malformed item needs inspection or quarantine rather than an endless loop that blocks unrelated updates.
A dead-letter destination is a place to retain and inspect failed work. It does not mean the product obligation completed. Preserve the original identity, failure evidence and a supported replay decision. Correcting a payload and replaying it must respect whether the original effect may already have happened.
A queue’s publication or delivery order does not automatically determine effect completion order across several workers. One slow job can finish after a later job. If product-version order matters, enforce the required rule at the state transition or choose processing organization that establishes it under failure.
Do not impose a global order merely because one product needs ordered updates. That can unnecessarily serialize unrelated products. Equally, do not claim per-key order without explaining how redelivery, ownership changes and parallel workers preserve the selected rule.
RabbitMQ’s documented separation of confirmations and acknowledgements gives a practical way to review the transport path. Northwind still owns how an acknowledged delivery maps to a valid projection effect. The broker is not the authority for whether a source version is eligible to replace another one.
Hypothetical failure scenario. The worker applies version 9, crashes before acknowledging, then receives an older version 8 ahead of the redelivered version 9. A handler blindly overwrites the search record on every delivery. The queue recovers messages successfully while the application regresses the representation.
Layer 3 · Internals
A webhook platform stores an event once and creates delivery obligations for each subscribed endpoint. Every attempt has a timeout and a stable event identity, while the recipient decides how to deduplicate its business effect. Sign the exact payload representation and include a timestamp or equivalent replay boundary; verifying a parsed and reserialized body can fail when its bytes differ.
Partition concurrency by endpoint or tenant so a slow destination cannot hold every delivery slot. Retry scheduling needs a declared retention horizon and increasing delay with jitter, but a timeout remains ambiguous: the recipient may have accepted the event before its response was lost. Replay should preserve event identity and record a new attempt rather than invent a new business event. Outbound requests also need destination validation at connection and redirect boundaries to avoid server-side request forgery. Revalidating only the URL entered during registration leaves DNS changes and redirects as later opportunities to cross the intended network boundary.
Trade-offs and limits
| Approach | Provides | Requires |
|---|---|---|
| Per-endpoint concurrency limits | Prevents one slow receiver consuming every slot. | A global scheduler still needs fair allocation and backlog bounds. |
| Large shared worker pool | Uses idle workers across many destinations. | Without endpoint isolation, slow requests can crowd out healthy tenants. |
Recovery decision
Hypothetical scenario: A registered URL redirects into a private network. Revalidate destinations and redirect policy; signing the payload does not prevent server-side request forgery.
No. They show the documented acknowledgement boundary. Preserve delivery identity and let the consumer implement its own effect/reconciliation contract.
Write your design before revealing the review
Can all successful HTTP responses be interpreted as the customer completing its business action?
Drafts and self-review are stored only in this browser. They are separate from reading completion.
Compare your decision
No. They show the documented acknowledgement boundary. Preserve delivery identity and let the consumer implement its own effect/reconciliation contract.
A registered URL redirects into a private network. Revalidate destinations and redirect policy; signing the payload does not prevent server-side request forgery.
Check your understanding
Can all successful HTTP responses be interpreted as the customer completing its business action?
No. They show the documented acknowledgement boundary. Preserve delivery identity and let the consumer implement its own effect/reconciliation contract.
How would you recover from this failure: A registered URL redirects into a private network. Revalidate destinations and redirect policy; signing the payload does not prevent server-side request forgery.
Start with the exact boundary that failed. Record an event and subscribed endpoint obligations. Validate each destination and prepare a signed versioned payload. Attempt under per-endpoint concurrency, timeout and retention policy. Then recover evidence through the observation path: Expose attempts and the strongest receipt evidence. Retry the same delivery identity with bounded backoff. Support replay without silently changing original event meaning. Preserve the distinction between a confirmed state change and an unavailable response.
Which assumption in the worked calculation would a burst or concentrated tenant invalidate first?
Hypothetical 1,000 events/s with five subscribed endpoints/event create 5,000 obligations/s. If 10% require one retry, attempt rate becomes 5,500/s under that chosen mix. One stalled endpoint must not consume the entire shared pool. Recompute the affected resource rather than multiplying unrelated storage and network budgets by the same factor. Deliver durable events to untrusted external endpoints with retry, expiry and tenant isolation. Endpoint acknowledgement is not proof of its downstream business effect.
Which component in this topology could be removed from a smaller first deployment?
Event journal, Endpoint obligations, Retry scheduler, Signed delivery name responsibilities, not a requirement for separate processes. Co-locate responsibilities when their transaction, trust and capacity boundaries permit it. Record an event and subscribed endpoint obligations.
What evidence must a caller have before relying on the observation path?
Expose attempts and the strongest receipt evidence. Retry the same delivery identity with bounded backoff. Support replay without silently changing original event meaning. No. They show the documented acknowledgement boundary. Preserve delivery identity and let the consumer implement its own effect/reconciliation contract.
45-minute interview rubric
- 00–05: scope webhook attempt and event and delivery attempt records.
- 05–12: identify the limiting resource and derive the domain workload above, retaining units and assumptions.
- 12–28: draw event and delivery attempt records, numbered writes and reads.
- 28–40: challenge recovery: Isolate endpoints, authenticate payloads and reconcile ambiguous delivery.
- 40–45: defend event_id placement, observations and remaining assumptions.
Go deeper
- Receive Stripe events in your webhook endpoint | Stripe Documentation · Primary document · docs.stripe.com. Isolate endpoints, authenticate payloads and reconcile ambiguous delivery. Verified 2026-10-26.
- Consumer Acknowledgements and Publisher Confirms | RabbitMQ · Primary document · www.rabbitmq.com. Isolate endpoints, authenticate payloads and reconcile ambiguous delivery. Verified 2026-10-26.
Decision log
Isolate endpoints, authenticate payloads and reconcile ambiguous delivery.
Preserve webhook attempt identity and event and delivery attempt records ownership.
Revisit changed workload, observations or recovery objectives.