Better Rate Limiting with Redis Sorted Sets
engineering.classdojo.com
engineering.classdojo.com
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.