Pattern 71 / CONTROL

Token Bucket

Use this when Allowing bursts while enforcing an average rate.

Pressure
Allowing bursts while enforcing an average rate
Mechanism
Refill tokens over time; each request spends a token or waits/fails
Toll
Burst size and refill rate must match real capacity
Architecture plate71
Diagram for Token Bucket
Executive brief

Token Bucket fits when Allowing bursts while enforcing an average rate. Mechanism: Refill tokens over time; each request spends a token or waits/fails. Use it for API quotas, client throttling, per-tenant limits. The toll: Burst size and refill rate must match real capacity.

Use when

Api quotas, client throttling, per-tenant limits.

Example

Use token bucket when api quotas, client throttling, per-tenant limits..

Review framing

Describe the pressure first, then the mechanism, then the cost. That keeps the design grounded.

Same pressure family

Traffic Control

72Leaky Bucket73Adaptive Concurrency Limit74Backpressure
โ† 7072 โ†’