node-rate-limiter-flexible icon indicating copy to clipboard operation
node-rate-limiter-flexible copied to clipboard

Created RedisRateLimiterNonAtomic

Open shameersheik opened this issue 3 months ago • 2 comments

Issue : https://github.com/animir/node-rate-limiter-flexible/issues/222

  1. Tested with npm run eslint

Introduces non atomic redis rate limiter

it is designed to be non-atomic, meaning it does not guarantee that limit checking and update operations are performed atomically. Advantages :

  1. It will be faster than RateLimiterRedis, as it does not wait till the Lua script is executed.
  2. Using lua scripts means that all operations are write operations that would go to a single Redis master write node, making read nodes useless. This implementation allows for read operations to be distributed across multiple Redis nodes, hence making it more scalable and faster. Disadvantages :
  3. This will be useful in scenarios where you want to allow concurrency and are okay with potential over-consumption of points till the read values are synced by redis.

shameersheik avatar Sep 01 '25 17:09 shameersheik

@shameersheik Hey, are you going to continue implementation of the non atomic limiter?

animir avatar Sep 23 '25 08:09 animir

@shameersheik Hey, are you going to continue implementation of the non atomic limiter?

Yeah, will let you know if I have any new updates.

shameersheik avatar Sep 23 '25 13:09 shameersheik