TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Better Rate Limiting with Redis Sorted Sets

7 pointsby StylifyYourBlogover 10 years ago

1 comment

heroicover 10 years ago
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:<p>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.<p>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.