Search code examples
hazelcast

Hazelcast replicatedmap not cached on client?


We are using a Hazelcast replicatedmap to keep track of the state of a small number (<100) of state entities.

Only a few instances (writers) will be updating state, while the rest are only reading them. We have many more lookups than changes, and it is ok for updates to be seen a bit late by readers (seconds late, not days). For performance reasons, it is important that the readers do not need to do a network call for a lookup, thus the replicatedmap.

Currently, the readers are hazelcast clients. But it looks to me like they are then not keeping a local copy of the data in the replicatedmap?

Do we need to make them members instead?


Solution

  • In a client-server architecture, you might find near-cache a better solution.

    The servers would host the data in an IMap rather than a ReplicatedMap, each client would have a copy. Clients would use their copy when available, and only go to the servers for items they don't have or that change.