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

In-App Notification Inbox & Unread Badge Store

Design an in-app notification center serving bell-icon unread counts and paginated inbox items where marking notifications read immediately clears the badge.

Max p99
≤ 40 ms
Availability
≥ 99.5%
Budget
≤ $4,900

Functional Requirements

  • FR-1POST /inbox/{user_id}/read — Marks notification IDs as read or appends new inbox items.
  • FR-2GET /inbox/{user_id} — Returns unread badge count and top-25 recent notifications.
  • FR-3PATCH & DELETE /inbox/{user_id}/read — Updates, cancels, or deletes user_id records and immediately invalidates or updates cached state (read-after-write).
  • FR-4Clearing unread notifications must immediately return 0 unread on refresh (read-after-write).

Workload Profile

Baseline App Opens38,000 Read RPS / 6,000 Inbox Write RPS
Breaking Push Surge104,000 Read RPS / 20,000 Write RPS
Active Working Set22 GB active unread counters & recent inbox slices
Fault ScenarioPrimary inbox database crash in Wave 3

Consistency Model

Read-after-write consistency required so dismissed unread badges never reappear from stale cache.

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