HLDArena
HLD-218·Messaging & Queues
Medium · 1,000 pts

CI/CD Pipeline Queue & Ephemeral Runner Dispatcher

Design a CI build scheduling and worker lease service matching queued workflow steps to autoscaled Linux/macOS runner pools with instant build cancellation.

Max p99
≤ 65 ms
Availability
≥ 99.5%
Budget
≤ $5,000

Functional Requirements

  • FR-1POST /pipelines/{repo_id}/runs — Enqueues commit workflow steps or cancels superseded runs.
  • FR-2GET /pipelines/{repo_id}/runs — Polls live step status for developer PR checks and runner heartbeats.
  • FR-3DELETE /pipelines/{repo_id}/runs — Releases canceled or expired leases/holds atomically and immediately refreshes cached availability.
  • FR-4Canceled superseded runs must immediately stop dispatching (read-after-write) and survive primary DB crash.

Workload Profile

Baseline Commits22,000 Read RPS / 8,500 Queue Write RPS
Release Freeze Rush62,000 Read RPS / 26,000 Write RPS
Active Working Set16 GB queued workflow DAGs & runner leases
Traffic DistributionSkewed commit storms on large monorepo repo_id queues

Consistency Model

Read-after-write consistency required for pipeline state/cancellation transitions; zero lost commit runs.

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
2,000 rps
Write RPS
400 rps
Key Distribution
Uniform (Low Skew)
Chaos Fault
None (Healthy Cluster)
Expected Pass CriteriaASSERTIONS
• Tail Latency: p99 ≤ 130 ms
• Availability: ≥ 99.5%
Valid end-to-end Client → Compute → Storage topology