I am building a leaderboard implementation using redis.
My question is if ZINCRBY is an atomic actions an can be used without a separate mutex or something in a multithreaded environment?
the documentation of ZINCRBY does not mention anything about atomic implemtnation as the documentation of INCR does for INCR, INCRBY and DECR
thanks a lot!
Yes, ZINCRBY is atomic. There is no need for external synchronization.
Redis is effectively single threaded. Even if two threads send commands to Redis concurrently, Redis will only execute them in a serial order.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With