Hello,
there is some article about a feature in Redisson where a local cache is kept on the side of the Java clients: "
Moving from Hazelcast to Redis". In this article there is a section named "Adding near-cache capabilities to Redis", where it says about Hazelcast having a local client-side cache: "It saves the network latency and the serialization/deserialization
processing in read operations. Our application does lots of read
operations.". The article mentions that such a feature had also been added to Redisson on their request to make their transformation from Hazelcast to Redisson easy.
Such a local cache would also be a useful feature for us, because we keep appending a lot strings to existing values, but we are happy with Jedis and won't change to something else. So it would be cool if such a local cache could also be added to Jedis. My question is now how that could be done. I guess the only way to notify other clients about strings being appended by one client is to make use of the publish/subscribe mechanism. My question is whether that is feasible or whether there is a better approach. Problem is that I'm very new to Jedis and therefore and don't know that much about it so far. So I better ask someone ;-).
What also strucks my mind is that with asynchronous pub/sub mechanism there is a chance for race conditions. But that is also the case when doing a get from one client to make sure to get the changes of the other clients. So I'm not too concerned about that as long as the order of publish is maintained when calling the subscribe callbacks.
Thanks for any input,
Haddock