Search code examples
redisrate-limitingredis-cluster

Concept about rate limiter constructed by redis cluster


I Have a concept problem about rate limiter constructed by redis/cluster mode. My problem is if I choose token bucket algorithm for rate limiter and use just one redis server, it works well. However if the traffic of redis is too much now, I would like to use redis/cluster mode for horizontal-scaling, but as I know, the redis/cluster mode is eventually consistent, so I think the value of each redis node will not be strongly consistent at the same time, the rate limiter will sometimes have some wrong calculation right? If so, how do I fix the issue, thank you very much.


Solution

  • Redis Cluster mode is eventually consistent from master node to replica nodes. Any change is immediate within the master node itself. So if you are reading only from master nodes, consistency would not be an issue.