sysdesign-rate-limiting-strategies

Selects rate-limiting algorithms and counter stores for per-user, per-endpoint, per-API-key, or per-IP scopes.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/danilods/matilha-sysdesign-pack --skill sysdesign-rate-limiting-strategies
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sysdesign-rate-limiting-strategies
Source: https://github.com/danilods/matilha-sysdesign-pack/tree/main/skills/sysdesign-rate-limiting-strategies
Command: npx skills add https://github.com/danilods/matilha-sysdesign-pack --skill sysdesign-rate-limiting-strategies

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rate-limiting strategy selection and implementation guidance to prevent abuse while preserving user experience.

Core Features & Use Cases

  • Pick among token bucket, leaky bucket, fixed window, and sliding window based on burst patterns.
  • Decide between stateful and stateless counters and appropriate counter stores (Redis, DynamoDB, in-process).
  • Define a clear 429 contract, shadow-mode rollout, and observability dashboards for per-scope blocking.

Quick Start

Provide a design outline that selects one rate-limiting algorithm (token bucket, leaky bucket, fixed window, or sliding window), chooses a stateful or stateless counter store, and documents the burst handling and 429 contract.

Frequently Asked Questions about sysdesign-rate-limiting-strategies

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose the best rate-limiting algorithm for my API?

Compare rate-limiting algorithms by evaluating burst handling needs: token bucket allows bursts up to capacity, leaky bucket smooths output flow, fixed window resets counts per period, and sliding window prevents boundary spikes for precise throttling.

When should I use Redis or DynamoDB for API throttling counters?

Use Redis, DynamoDB, or in-process stores for API throttling counters based on whether you need stateful or stateless limits. Stateful counters in distributed stores like Redis preserve limits across restarts, while stateless approaches reduce latency.

How do I configure a 429 response contract for API rate limits?

Configure a 429 response contract for API rate limits by documenting the retry-after headers, per-scope blocking details, and throttling scope definitions. A clear contract informs clients when to retry requests after hitting rate boundaries.

Does rate limiting support shadow-mode rollout and observability dashboards?

Apply rate limiting per user, endpoint, API key, or IP by defining scope definitions that target specific traffic dimensions. Scoping ensures throttling rules apply precisely to the identified abuse vector while leaving other traffic unaffected.

What are the limitations of fixed window rate limiting?

Fixed window rate limiting has limitations with boundary bursts, where traffic spikes occur exactly at window reset points. Sliding window or token bucket strategies mitigate this by distributing capacity over time for better burst control.