Hazelcast Tip: When to use near-cache?

What is near-cache?

In distributed architectures, obviously remote operations are more costly than local ones so you should try to increase the local ops/remote ops ratio in your system.

Near-cache is a feature that you can use to increase this ratio for your Hazelcast cluster.

Enabling near-cache, when an object is fetched from remote node, it is put to local cache, so subsequent requests are handled by local node retrieving from local cache.

Of course, this is not free. You gain performance but causes extra memory cost and breaks consistency proportional to lifespan you set for the cached records.

So when to use near cache?

If your read rate for a map is much higher than write rate, then near-cache makes sense.

More reading on caching with Hazelcast.