HLDArena
HLD-311·Messaging & Fan-out
Hard · 1,500 pts

10M-Concurrent User Presence Heartbeat & Guild Fan-Out

Design Discord / Slack’s real-time online/idle/DND presence system handling millions of WebSocket heartbeats and large-server member-list status subscriptions.

Max p99
≤ 50 ms
Availability
≥ 99.5%
Budget
≤ $8,500

Functional Requirements

  • FR-1POST /presence/{guild_id}/heartbeat — Updates user online status TTL and broadcasts state transitions.
  • FR-2GET /presence/{guild_id}/snapshot — Serves active online roster for newly opened guild channels.
  • FR-3PATCH & DELETE /presence/{guild_id}/heartbeat — Updates, revokes, or deletes guild_id entries with bounded TTL or explicit cache/index invalidation.
  • FR-4Must absorb massive gaming-launch guild spikes and survive 6x storage brownouts without heartbeat storms.

Workload Profile

Baseline Guilds55,000 Roster Read RPS / 14,000 Heartbeat Write RPS
Game Launch Mega-Guild Peak148,000 Read RPS / 32,000 Write RPS
Active Working Set36 GB guild presence bitmaps & session leases
Contention ProfileExtreme hotspot on 500k-member official guild_id servers

Consistency Model

Bounded eventual presence propagation (< 5s) across large guilds using windowed batching.

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 ≤ 100 ms
• Availability: ≥ 99.5%
Valid end-to-end Client → Compute → Storage topology