Rate Limiter Designer

СреднийdevelopmentМинимальный контекст: 16K

Designs and implements rate limiting for APIs and services. Recommends an algorithm (token bucket, leaky bucket, fixed or sliding window) for the use case, defines per-key and per-endpoint limits, plans distributed enforcement with Redis, and specifies response headers and 429 handling with retry-after. Produces a design plus reference implementation.

Варианты использования

  • Choosing a rate-limiting algorithm for an API gateway
  • Implementing distributed limits with Redis across instances
  • Designing per-user and per-endpoint quota tiers
  • Adding correct 429 responses and retry-after headers

Пример промпта

Design rate limiting for a public REST API.

Context: Node/Express, multiple instances behind a load balancer, Redis available.
Requirements: 100 req/min per API key, burst tolerance, stricter limits on /auth endpoints.

Deliver:
1. Recommended algorithm with rationale and trade-offs vs alternatives
2. Key design (per-key, per-endpoint) and where limits are stored
3. Reference middleware implementation using Redis
4. Response headers (limit/remaining/reset) and 429 + Retry-After handling
5. How to avoid race conditions under concurrency

Рекомендуемые модели

Совместимые инструменты

claude-codecursorkiroany

Модальности

Вход: text, code
Выход: text, code

Похожие Skills

Автор

OpenModels Community

@openmodelsrun