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:
- Read the serialized entity for a specific key in one roundtrip
- Write the modifiend entity back to redis. If any other client modified the entity between the read and the write the operation will fail
Is this possible to do in redis? And if so: what redis commands should be executed to do this?