HLDArena
HLD-402·Messaging & Fan-out
Expert · 2,000 pts

Global Real-Time Social Timeline Feed

Design a global timeline read/write architecture handling 220k+ RPS feed fetches, celebrity hot-key traffic skew, read-after-write consistency, and downstream storage brownouts.

Max p99
≤ 95 ms
Availability
≥ 99.6%
Budget
≤ $8,500

Functional Requirements

  • FR-1POST /posts — Publishes a new post from author user_id.
  • FR-2GET /timeline/{user_id} — Fetches the ranked recent feed for user_id.
  • FR-3Read-after-write guarantee: authors and active readers must not be served stale un-invalidated caches.
  • FR-4System must degrade gracefully without cascading retry storms when storage tail latency spikes 8x.

Workload Profile

Baseline Traffic85,000 Read RPS / 6,000 Write RPS
Breaking News Peak220,000 Read RPS / 15,000 Write RPS
Active Working Set64 GB hot timelines & celebrity posts
Fault ScenarioDownstream storage 8x gray latency spike in Wave 3

Consistency Model

Read-after-write consistency required (stale un-invalidated cache windows > 15s fail verification).

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