Is Redis ZINCRBY Atomic?

I am creating a leader implementation using redis.

My question is, what are ZINCRBY atomic actions that can be used without a separate mutex or something in a multi-threaded environment?

ZINCRBY documentation does not mention anything about atomic implementation as INCR documentation for INCR, INCRBY and DECR

Many thanks!

+5
source share
1 answer

Yes, ZINCRBY is atomic. External synchronization is not required.

Redis is efficiently single-threaded. Even if two threads send Redis commands at the same time, Redis will only execute them in sequential order.

+7
source

All Articles