3 ms·
We do the same but instead of using redis we built our own service for it currently on top of leveldb instead of using redis. This allow us to define the param
by jfroma 10y ago
We do the same but instead of using redis we built our own service for it currently on top of leveldb instead of using redis.
This allow us to define the parameters of the token bucket on the service instead of the application like:
'requests':
per_second: 100
size: 200
Then in the app is like
conformant = limitd.take('request', ip, 1)
I found the token bucket alg to be useful in a lot of scenarios not only for rate limiting but also for any kind of event debouncing. A common example: lets say you want to email a user everytime they trigger some condition on the system but you dont want to send the same mail more than once a day.
Our project is opensource, we still working on it:
https://github.com/auth0/limitd https://github.com/auth0/limitd