Last Updated: June 6, 2026
A gateway protects backends by rate limiting at the edge. The token bucket is the classic algorithm: requests spend tokens, and tokens refill over time. Write the bucket so it allows bursts up to its capacity and then paces the rest.