

Better Rate Limiting with Redis Sorted Sets - StylifyYourBlog
http://engineering.classdojo.com/blog/2015/02/06/rolling-rate-limiter/

======
heroic
If say you wanted to perform an action 10 times a minute and also maintain a
gap(in other words, time between action to be 6 seconds), could you simply not
have done this:

1) Use SETNX, if you are able to do it, then set a TTL of 6 seconds on the
key. Do these in a MULTI. 2) Perform action.

Now you have rate limiting as well as gap between actions. Also, no blocked
actions, will affect anything. If I got something wrong from your post, do let
me know.

