问题
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
回答1:
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 :)
来源:https://stackoverflow.com/questions/40104361/hazelcastinstance-vs-hazelcastclient