#03Distributed Rate Limiter
3 / 20
Cloudflare logoCloudflare System
EasyInfrastructure
20–30 min

Distributed Rate Limiter

Design an edge-tier rate limiting system to protect APIs against abuse, credential stuffing, and DDoS using sliding-window counter algorithms and fast distributed caches.

Scale & Traffic50,000 requests/sec · < 2ms latency penalty
Monthly Cloud Budget$1,200/month
Latency Target (P99)< 50ms Realtime SLA
Availability SLA99.99% Multi-AZ Active

System Requirements

  • Support customizable limits per IP, User ID, and API Key
  • Sub-2ms check latency with distributed synchronization
  • Graceful degradation to allow traffic if rate limiter cluster fails (fail-open)
  • Return HTTP 429 Too Many Requests with Retry-After header

Graded Constraints

01Cost within $1,200/month
02Edge Reverse Proxy or API Gateway connected to distributed cache
03In-memory store (Redis / Memcached) for sliding window timestamps
04Centralized rule storage (Database) for policy configuration

Ready to design?

Open this challenge in the interactive system design playground and satisfy all architecture constraints.

Explore More

Related Architecture Challenges

All Problems
Distributed Rate Limiter — System Design Problem | Mimir Nest