simpleusr
simpleusr

Reputation: 374

Hazelcast - What is the best cluster topology to serve multiple applications in client/server mode?

Almost all of our applications are using Hazelcast cluster in embedded topology. Due to high load on the applications, we are occasionally having memory and cpu problems. Because of this we are planning to change our topology from embedded to client/server mode.

The question is, should we set up a new cluster for each application? Or should a single cluster serve all the client applications?

I know that multiple hazelcast instances can be started in jvm (http://docs.hazelcast.org/docs/3.5/manual/html/createclustergroups.html). Could this also be an option for production?

Upvotes: 1

Views: 1303

Answers (1)

A.K.Desai
A.K.Desai

Reputation: 1294

Let's analyze based on the use-cases.

  • UseCase-1: The Hazelcast cluster is mainly used as a Distributed cache. In this case, you can simply keep a common cluster and all the applications can maintain HazelcastClient to access the cluster.
  • UseCase-2: The Hazelcast cluster is being used both as a Distributed Cache as well as Distributed Computing purpose using executors. In this case, you need to analyze the amount of data that you will be storing in the cluster and the type of calculations that you will be running using executor pool. You will have to take the number of CPU/Cores also into consideration while allocating the nodes across multiple servers.

Best Practices

  • Keep the HazelcastClient objects as singleton so that the connection would be reused for each requests instead of creating multiple client connections adding network overhead which can impact the performance.

  • Utilize the NearCache feature wherever applicable, to cache the frequently accessed data at the client side itself instead of making a trip to the cluster for each call.

  • It's better to start each node in their own JVMs instead of running multiple nodes inside a single JVM. Any unforeseen issue in parent JVM will lead to crashing of all the nodes.

Upvotes: 1

Related Questions