token bucket or leaky bucket, which one is better?
Farah Shafiq
·1463 views
Hey everyone, I'm trying to figure out the best way to set up rate limiting for a new API I'm building and wanted to see what you all think. I'm mainly looking at Token Bucket versus Leaky Bucket. Token Bucket feels like it handles traffic spikes better, but Leaky Bucket makes things more consistent. What do you usually do for rate limiting, and why do you prefer it? Have you run into any unexpected problems or have advice on picking between those two?
35 comments