HLDArena
HLD-123·Storage & Caching
Easy · 500 pts

Mobile APNs / FCM Device Token & Topic Registry

Design a mobile device-token registration and topic fan-out lookup store queried by notification workers during breaking-news broadcasts.

Max p99
≤ 45 ms
Availability
≥ 99.5%
Budget
≤ $2,550

Functional Requirements

  • FR-1PUT /devices/{user_id}/tokens — Upserts APNs/FCM push token and app locale on app launch.
  • FR-2GET /devices/{user_id}/tokens — Fetches active push tokens for outbound alert delivery.
  • FR-3PATCH & DELETE /devices/{user_id}/tokens — Updates, revokes, or deletes user_id entries with bounded TTL or explicit cache/index invalidation.
  • FR-4Must remain available across single storage node failures.

Workload Profile

Baseline App Opens19,000 Read RPS / 3,200 Token Upsert RPS
Morning Push Broadcast54,000 Read RPS / 8,500 Upsert RPS
Active Working Set14 GB active user token mappings
Traffic DistributionSkewed lookups on active user_id cohorts

Consistency Model

Eventual token propagation (< 5s) acceptable; invalid tokens pruned asynchronously.

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