Token Bucket

It works by allocating a fixed number of tokens to each user, which they can use to make requests. As tokens are used up, they are gradually replenished over time. If a user runs out of tokens, they must wait for more tokens to become available before they can make additional requests.


It allows bursts up to the current number of tokens in token bucket

Leaky Bucket

The bucket(analog to a server processing request) process(leak) at a constant rate, where every request is represented by a drop of water that enters the bucket.
When the bucket is full, any incoming request is rejected or queued


The leaky bucket algorithm smooths out bursts by processing requests at a constant rate