nebulex_examples icon indicating copy to clipboard operation
nebulex_examples copied to clipboard

Near Cache Topology – Writes are not updating L1 Cache on another nodes of the cluster

Open HammamSamara opened this issue 3 years ago • 0 comments

It seems however I try to update a key on one node, the other nodes which have seen the key before won't update their L1 cache. Besides setting a ttl value on L1, is there anyway to invalidate the L1 on other nodes upon updating? I am having a situation where I can't serve a stale value once a newer version of data runs over the cluster.

Example:

iex([email protected])> NearCache.put "foo", "bar"
:ok

iex([email protected])> NearCache.get "foo"          
"bar"

iex([email protected])> NearCache.put "foo", "new bar"
:ok

iex([email protected])> NearCache.get "foo"          
"bar"

iex([email protected])> NearCache.get "foo", level: 2        
"new bar"

iex([email protected])> NearCache.replace "foo", "baz"
:ok

iex([email protected])> NearCache.get "foo"          
"bar"

HammamSamara avatar Nov 08 '21 13:11 HammamSamara