HLDArena
HLD-107·Coordination & IDs
Easy · 500 pts

Distributed 64-Bit ID & Sequence Service

Design a high-throughput unique ID allocation service issuing time-ordered 64-bit identifiers and range leases to internal microservices.

Max p99
≤ 22 ms
Availability
≥ 99.5%
Budget
≤ $1,850

Functional Requirements

  • FR-1POST /v1/ids/batch — Allocates guaranteed-unique ID blocks or Snowflake worker leases.
  • FR-2GET /v1/ids/{shard_id}/meta — Inspects shard epoch and worker lease health.
  • FR-3DELETE /v1/ids/batch/{shard_id} — Releases canceled or expired leases/holds atomically and immediately refreshes cached availability.
  • FR-4Must survive a primary state node crash without issuing duplicate IDs or stalling callers.

Workload Profile

Baseline Requests16,000 Read RPS / 6,500 Lease/Mint Write RPS
Peak Minting Surge42,000 Read RPS / 18,000 Write RPS
Active Working Set4 GB worker epoch & sequence lease state
Latency BudgetCore RPC dependency requiring p99 <= 22 ms

Consistency Model

Monotonic rough time-ordering per worker with durable lease checkpoints across replica nodes.

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