What is the difference between Leaky bucket and Token bucket approach during rate limiting?

I am researching rate limiting and encountered those two strategies: leaky bucket and token bucket. After reading several articles these strategies seem the same too me, but all articles are mentioning different pros and cons for those approaches so I must be missing something. As I understand they use the same algorithm but use different names. Leaky bucket Token bucket Description space left number of tokens Size of burst we can handle in this moment space filled max - number of tokens How much more burst we can accumulate if we did not perform any requests leak rate refill rate Minimum amount of requests we can handle in time, also how quickly we accumulate burst capability I don't see any significant difference here. In leaky bucket you count from 0 to max in the other from max to 0 and that's the main difference. Why there are different pros and cons? What I am missing?

Jun 7, 2025 - 14:30
 0

I am researching rate limiting and encountered those two strategies: leaky bucket and token bucket. After reading several articles these strategies seem the same too me, but all articles are mentioning different pros and cons for those approaches so I must be missing something.

As I understand they use the same algorithm but use different names.

Leaky bucket Token bucket Description
space left number of tokens Size of burst we can handle in this moment
space filled max - number of tokens How much more burst we can accumulate if we did not perform any requests
leak rate refill rate Minimum amount of requests we can handle in time, also how quickly we accumulate burst capability

I don't see any significant difference here. In leaky bucket you count from 0 to max in the other from max to 0 and that's the main difference. Why there are different pros and cons? What I am missing?