Knowing what data was affected by Hazelcast members joining or leaving cluster

Viewed 163

Our server-sided solution makes use of Hazelcast-provided distributed data structures to make available state related to entities that live on particular cluster members.

When a cluster member joins or leaves the cluster, we have a need for the other cluster nodes to be aware of 'what changed': for example, when a cluster member leaves, the other cluster members need to be able to determine what entities have become unavailable as a result of the cluster event, separating that from the changes in availability of entities that have other causes (eg: related to the normal lifecycle behavior of such entities).

A naive implementation could be based on a keeping a record, on each cluster member, that tracks what resources is provided by what cluster member. Such a record could then be used when cluster events are detected. However, this very much feels like re-inventing a wheel.

Can Hazelcast facilitate a solution?

1 Answers

Such granular level housekeeping is neither feasible nor recommended for any distributed system because it adds significant overhead. In case of Hazelcast, there are provisions that can give you some insight into the state of the data when cluster topology changes. Try PartitionLostListener and/or Migration Listener.

Related