javainfinispaninfinispan-8

Grouping api in Infinispan


I have been trying to implement a project that would always store an particular value in an particular node in Infinispan 8.1.If that node is down,the values in that cache should be moved to another node. I have heard about Grouping api which supports my requirement,But, i just want to confirm that if that node is down,whether all the values will be moved to the secondary owner node or not.


Solution

  • Grouping API doesn't guarantee that an entry is stored on a particular node. It guarantees that entries in the same group are stored on the same node [1].

    The KeyAffinity API [2] can help ensure that an entry is stored on a specific node. However it will only be stored on that specific node under a stable topology. If the topology changes there are no guarantees that it is still stored on that node, even if it is still around.

    In either case if you are using a Distributed cache with at least numOwners >= 2, then the data will be retained (and moved between nodes as needed) as long as you don't have concurrent failures >= numOwners.

    [1] http://infinispan.org/docs/dev/user_guide/user_guide.html#grouping

    [2] http://infinispan.org/docs/dev/user_guide/user_guide.html#KeyAffinityService