HazelcastInstance vs HazelcastClient
Asked Answered
B

1

12

I am novice in hazelcast and I have a few questions.

As I understand hazelcast comes with two entities HazelcastInstance(as I understand it is server) and HazelcastClient.
These entities even packed into different jars.

I have noticed that in our project we use only HazelcastInstance. I have asked collegues why don't we use HazelcastClient. As I understand their explanation HazelcastInstance has more possibilities than HazelcastClient. Thus

HazelcastInstance = HazelcastClient + AnotherFeatures

But for me it strange that these entities packed to different packages if it is truth.

Please explain me when should I use HazelcastClient and when HazelcastInstance

Bloomington answered 18/10, 2016 at 9:23 Comment(0)
B
10

HazelcastInstance, as you said correctly, is a Hazelcast member instance. Therefore it stores information and can execute tasks in the cluster. A HazelcastClient though is just a proxy to another running Hazelcast cluster. You can imagine it as the JDBC connector when thinking about relational databases. It neither stores data itself, nor does it execute tasks sent through the ExecutorService feature.

If your colleague name it "more features", well fair enough, I would prefer to say server-server environment and client-server environment :)

Bubble answered 18/10, 2016 at 9:45 Comment(2)
please, explain me when should I choose HazelcastClient instead of HazelcastInstance ?Bloomington
We always recommend client-server over embedded clusters (server-server only). That said, you're most likely to see HazelcastClient in your applications. In the end it depends on your architecture. You probably should read the introduction chapter of the Hazelcast documentation to get a better insight in how Hazelcast works internally and what are benefits of different topology setups.Bubble

© 2022 - 2024 — McMap. All rights reserved.