SysPad › Examples › Rate limiter
Rate limiter
Sliding-window rate limiting at the edge. A limiter fleet checks and increments a sharded Redis counter before requests reach the backend, with live-updatable rules and an async metrics pipeline.
Why the counter store, not the backend, is the bottleneck: allowed and throttled traffic both hit it, so it saturates first under combined load.
- Throughput: 5,000 req/sec
- First to saturate: Decision Events
- Estimated cost: $44k/mo
How it works
- Rules Store
- Per-client and per-API limits. Admins update it live; the limiter fleet reads it rarely (cached in process).
- Counter Cluster
- The real bottleneck: every allowed AND throttled request checks a counter here, so it sees more load than the backend it guards. Sharded, and replicated for HA.
Request flows
Allowed request
- Clients
- API Gateway
- Rate Limiter
- Rules Store
- Counter Cluster
- Backend API
- App Cache
- App Data
Throttled request
- Clients
- API Gateway
- Rate Limiter
- Rules Store
- Counter Cluster
Decision metrics
- Clients
- API Gateway
- Rate Limiter
- Decision Events
- Metrics Aggregator
- Metrics Lake
Rule update
- Rules Admin
- Rules Store