HLDArena
HLD-104·Messaging & Queues
Easy · 500 pts

Webhook & Transactional Notification Dispatcher

Design an event-driven notification and webhook ingestion pipeline that buffers sudden merchant traffic bursts and tracks delivery state without losing events.

Max p99
≤ 85 ms
Availability
≥ 99.5%
Budget
≤ $2,200

Functional Requirements

  • FR-1POST /webhooks/send — Accepts an outbound event payload, persists/enqueues it durably, and returns 202 Accepted.
  • FR-2GET /webhooks/{webhook_id}/status — Queries delivery state and attempt history.
  • FR-3DELETE /webhooks/send/{tenant_id} — Supports tenant retention TTL expiry, rule updates, or stream cleanup while keeping recent rollup caches fresh.
  • FR-4Must survive a primary database node crash without dropping queued notifications.

Workload Profile

Baseline Load10,000 Status Read RPS / 6,000 Enqueue Write RPS
Merchant Peak28,000 Read RPS / 22,000 Enqueue Write RPS
Active Working Set8 GB recent delivery status metadata
Traffic DistributionModerate tenant skew on large merchant_id accounts

Consistency Model

At-least-once asynchronous delivery with eventual status visibility (< 3s); zero lost accepted webhooks.

Design Write-up
0 boxes · 0 edges
0 words
Hidden Cases #4–#7 run automatically on Submit
Case 1: Smoke & API ContractInput Workload
Read RPS
1,000 rps
Write RPS
400 rps
Key Distribution
Uniform (Low Skew)
Chaos Fault
None (Healthy Cluster)
Expected Pass CriteriaASSERTIONS
• Tail Latency: p99 ≤ 170 ms
• Availability: ≥ 99.5%
Valid end-to-end Client → Compute → Storage topology