HLDArena
HLD-204·Caching & Consistency
Medium · 1,000 pts

Viral News Article Comment Thread Backend

Design a nested comment thread service for a global news publisher handling extreme read skew on breaking front-page stories.

Max p99
≤ 48 ms
Availability
≥ 99.5%
Budget
≤ $4,300

Functional Requirements

  • FR-1GET /articles/{article_id}/comments — Fetches paginated top/recent comment tree.
  • FR-2POST /articles/{article_id}/comments — Creates and publishes a user comment with immediate author visibility.
  • FR-3PATCH & DELETE /articles/{article_id}/comments/{comment_id} — Edits or moderates/deletes comments and immediately invalidates cached threads.
  • FR-4Must remain fast and available when backing storage suffers a 6x latency brownout.

Workload Profile

Baseline Traffic42,000 Read RPS / 2,800 Comment Write RPS
Breaking Story Peak130,000 Read RPS / 8,000 Write RPS
Active Working Set28 GB active front-page comment threads
Traffic DistributionHeavy Zipfian skew on top 0.1% article_id threads

Consistency Model

Read-after-write consistency required so commenters immediately see their posted replies (cache invalidation or write-through).

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