An alternative approach to rate limiting
Nikrad Mahdi

You can implement leaky bucket atomicly with Reids using Eval. Simply use Redis hashes to store drain rate, last time of insert, fullness, and max capacity. Then use an EVAL script to calculate the fullness of the bucket and drain the appropriate load atomically. Reject the EVAL if it is full.

Show your support

Clapping shows how much you appreciated Nicholas Wong’s story.