| name | rate-limiting-design |
| enabled | true |
| description | Use when performing rate limiting design — guides teams through designing and
implementing rate limiting strategies for APIs and services. This template
covers algorithm selection, limit configuration, client communication, and
monitoring to protect backend systems from abuse and overload while
maintaining a good developer experience.
|
| required_connections | [{"prefix":"api-gateway","label":"API Gateway"},{"prefix":"monitoring","label":"Monitoring Platform"}] |
| config_fields | [{"key":"service_name","label":"Service Name","required":true,"placeholder":"e.g., Public REST API"},{"key":"rate_limit_strategy","label":"Rate Limiting Strategy","required":true,"placeholder":"e.g., Token Bucket, Sliding Window, Fixed Window"}] |
| features | ["RATE_LIMITING","API_DESIGN","RELIABILITY"] |
Rate Limiting Design
Phase 1: Requirements Gathering
Define the goals and constraints for rate limiting.
| Client Type | Expected RPS | Burst Tolerance | SLA Tier |
|---|
| | | |
Phase 2: Algorithm Selection
Evaluate and select the rate limiting algorithm.
| Algorithm | Pros | Cons | Fit |
|---|
| Fixed Window | Simple, low memory | Burst at window edges | |
| Sliding Window Log | Accurate | High memory for high-volume | |
| Sliding Window Counter | Good accuracy, low memory | Slight approximation | |
| Token Bucket | Allows controlled bursts | Slightly complex | |
| Leaky Bucket | Smooth output rate | No burst tolerance | |
Phase 3: Limit Configuration
Define rate limits per client tier and endpoint.
| Endpoint / Group | Tier | Requests per Window | Window Size | Burst Limit |
|---|
| | | | |
Graduated Limits:
Phase 4: Implementation Design
Phase 5: Monitoring and Alerting
Counter-Rationalizations
| Shortcut | Counter | Why |
|---|
| "We can skip some steps for this case" | Adapt the workflow steps, don't skip them | Skipped steps are where incidents and oversights originate |
| "The user seems to already know what to do" | Complete all workflow phases with the user | The workflow catches blind spots that experience alone misses |
| "This is a minor case, full process is overkill" | Scale the process down, don't turn it off | Minor cases become major when unstructured; the process scales, not disappears |
| "I'll fill in the details later" | Complete each section before moving on | Deferred details are forgotten; real-time capture is more accurate |
| "The template output isn't necessary" | Always produce the structured output format | Structured output enables comparison, audit trails, and handoff to other teams |
Output Format
Summary
- Service: ___
- Algorithm: ___
- Enforcement point: ___
- Client tiers: ___
- Endpoints covered: ___
Action Items