Working in an application that stores entities in redis as a serialized binary blob. I have multiple clients working on the same data set and I wish to use optimistic concurrency.
My requirements are these:
Is this possible to do in redis? And if so: what redis commands should be executed to do this?
WATCH key
, GET key
, MULTI
, SET key
, then EXEC
. The EXEC
will fail if the key's value has changed since you executed the WATCH
.
http://redis.io/topics/transactions#cas
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