You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by javadevmtl <ja...@gmail.com> on 2019/01/08 22:01:24 UTC

Single or multiple instances of Ignite and IgniteCache

I understand that Ignite and IgniteCache are thread safe...

When I create my instance of Ignite is it better to instantiate multiple
instances of both Ignite and IgniteCache or is it better to build them
through a singleton?

So far it doesn't seem to matter and it's easier to Ingnition.getOrStart()
then to try to synchronize the creation of the grid instance. Also as an
additional note Ignite is started as client only node...



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Single or multiple instances of Ignite and IgniteCache

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

You can always do Ingnition.getOrStart(), it will be an effective singleton.
Same with getOrCreateCache().
Keeping an instance might be slightly faster but that should not be very
important.

However, if you have more than one node you better keep explicit references
to them to avoid talking to wrong instance.

Regards,
-- 
Ilya Kasnacheev


ср, 9 янв. 2019 г. в 01:01, javadevmtl <ja...@gmail.com>:

> I understand that Ignite and IgniteCache are thread safe...
>
> When I create my instance of Ignite is it better to instantiate multiple
> instances of both Ignite and IgniteCache or is it better to build them
> through a singleton?
>
> So far it doesn't seem to matter and it's easier to Ingnition.getOrStart()
> then to try to synchronize the creation of the grid instance. Also as an
> additional note Ignite is started as client only node...
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>