---
answer: direct
beat: system-design
source: 1 article · updated: August 6, 2026
---

When should I use leaky bucket instead of token bucket?

Leaky bucket (a queue that drains at a fixed rate) smooths output perfectly but adds latency and memory overhead. Use it for jobs that can queue (e.g., image resizing). Token bucket is better for synchronous APIs where excess traffic must be rejected immediately—it absorbs small bursts while respecting the limit.

Answered in

Token Buckets: Bounding Rate Limits at the Edge

Fixed-window counters leak at boundaries. Token buckets refill steadily, absorb bursts, and bound the sustained rate strictly—the algorithm Stripe uses.

Crashtech Editorial August 6, 2026 System Design

Read the full analysis

Other questions this article answers

More system design questions

Every answer on Crashtech is written by the editor of the article it comes from — never auto-summarised. Browse all answers or the System Design beat.