HLDArena
HLD-414·Rate Limiting
Expert · 2,000 pts

Anycast L7 WAF, Bot Reputation & Global Token-Bucket Edge

Design Cloudflare / Akamai’s global L7 Web Application Firewall evaluating JA4 TLS fingerprints, dynamic WAF rulesets, and distributed rate limits at 280k+ RPS.

Max p99
≤ 32 ms
Availability
≥ 99.6%
Budget
≤ $11,900

Functional Requirements

  • FR-1POST /waf/evaluate — Checks compiled customer WAF ruleset, IP/JA4 reputation, and edge token bucket.
  • FR-2POST /waf/rules/{zone_id} — Pushes emergency zero-day mitigation rules across global POPs.
  • FR-3PATCH & DELETE /waf/evaluate/{zone_id} — Updates, revokes, or deletes zone_id entries with bounded TTL or explicit cache/index invalidation.
  • FR-4Must sustain p99 <= 32ms during volumetric botnet floods and 8x origin analytics brownouts.

Workload Profile

Steady Edge Ingress95,000 WAF Check RPS / 10,000 Reputation/Counter Write RPS
Volumetric L7 Botnet Attack250,000 Check RPS / 32,000 Counter Write RPS
Active Working Set48 GB compiled zone WAF rulesets & hot ASN/JA4 scores
Latency GateUltra-strict inline edge budget p99 <= 32 ms

Consistency Model

Sub-2s eventual rule & reputation gossip across edge POPs; fail-open/cached fallback on origin brownout.

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