Logo
Grokking the System Design Interview
Ask Author
Back to course home

0% completed

Token Bucket vs Leaky Bucket

Token Bucket and Leaky Bucket are two algorithms used for network traffic shaping and rate limiting. They help manage the rate of traffic flow in a network, but they do so in slightly different ways.

Token Bucket Algorithm

  • Mechanism: The token bucket algorithm is based on tokens being added to a bucket at a fixed rate. Each token represents permission to send a certain amount of data. When a packet (data) needs to be sent, it can only be transmitted if there is a token available, which is then removed from the bucket.
  • Characteristics:

.....

.....

.....

Like the course? Get enrolled and start learning!