name: design-a-rate-limit-and-quota-policy
description: Design a rate-limit and quota policy that protects capacity while serving fair demand. Use when the user needs to protect an API or service from excessive or unfair usage.
domain: architecture-design
tags: [rate-limiting, quotas, capacity-protection]
triggers: ["api rate limit policy", "design request quotas", "rate limiting architecture"]
Design a rate-limit and quota policy that protects capacity while serving fair demand
Purpose
Design a rate-limit and quota policy that protects capacity while serving fair demand.
When to use
Use when the user needs to protect an API or service from excessive or unfair usage.
When NOT to use
Do not use this for a local implementation detail; use software-engineering instead.
Inputs required
- The functional and non-functional requirements
- The constraints on scale, budget and timeline
- The existing systems the design must fit
Procedure
- Identify protected endpoints, capacity limits, client tiers, and legitimate peak demand.
- Choose the rate-limit algorithm, measurement window, burst allowance, and enforcement scope.
- Define quota allocation, rollover rules, renewal windows, and exemptions.
- Specify limit headers, error responses, retry guidance, and client-identification rules.
- Plan storage, distributed enforcement, administrative overrides, and audit records.
- Test fairness, overload behavior, and fail-open or fail-closed assumptions before rollout.
Output contract
A design with components, interfaces, data flows, failure modes and a migration path.
Validation checklist
Safety notes
Never present a design as final without stating the assumptions it depends on.
Related skills
design-a-file-upload-and-processing-flow
choose-between-a-modular-monolith-and-microservices
design-a-batch-processing-pipeline
1---2name: design-a-rate-limit-and-quota-policy3description: Design a rate-limit and quota policy that protects capacity while serving fair demand. Use when the user needs to protect an API or service from excessive or un4---5---6name: design-a-rate-limit-and-quota-policy7description: Design a rate-limit and quota policy that protects capacity while serving fair demand. Use when the user needs to protect an API or service from excessive or unfair usage.8domain: architecture-design9tags: [rate-limiting, quotas, capacity-protection]10triggers: ["api rate limit policy", "design request quotas", "rate limiting architecture"]11---1213# Design a rate-limit and quota policy that protects capacity while serving fair demand1415## Purpose1617Design a rate-limit and quota policy that protects capacity while serving fair demand.1819## When to use2021Use when the user needs to protect an API or service from excessive or unfair usage.2223## When NOT to use2425Do not use this for a local implementation detail; use software-engineering instead.2627## Inputs required2829- The functional and non-functional requirements30- The constraints on scale, budget and timeline31- The existing systems the design must fit3233## Procedure34351. Identify protected endpoints, capacity limits, client tiers, and legitimate peak demand.362. Choose the rate-limit algorithm, measurement window, burst allowance, and enforcement scope.373. Define quota allocation, rollover rules, renewal windows, and exemptions.384. Specify limit headers, error responses, retry guidance, and client-identification rules.395. Plan storage, distributed enforcement, administrative overrides, and audit records.406. Test fairness, overload behavior, and fail-open or fail-closed assumptions before rollout.4142## Output contract4344A design with components, interfaces, data flows, failure modes and a migration path.4546## Validation checklist4748- [ ] Every requirement maps to a component49- [ ] Failure and rollback paths are described50- [ ] The trade-offs behind the choice are written down5152## Safety notes5354Never present a design as final without stating the assumptions it depends on.5556## Related skills5758- `design-a-file-upload-and-processing-flow`59- `choose-between-a-modular-monolith-and-microservices`60- `design-a-batch-processing-pipeline`