Is a client expensive in terms of creation?

Hi,

Being used to working with Hibernate, for instance, I know that I shouldn't
be creating 'sessionFactory' instances happily, as they are quite expensive
to create.

So my question applies now to clients in ES: are they expensive to
create/destroy or, on the other hand, they are so light that I can
create/destroy them as many times as I want in my application?

My application uses the Transport Client to send index/search requests to a
remote ES server. And these requests' frequency can vary depending on
products' catalogs availability, so it could be from several times a day to
once a month for each catalog.

Thanks.

The client should be instantiated once and used throughout the lifecycle of the application. Similar to Hibernate SeassionFactory.
On Friday, February 4, 2011 at 2:05 PM, Enrique Medina Montenegro wrote:

Hi,

Being used to working with Hibernate, for instance, I know that I shouldn't be creating 'sessionFactory' instances happily, as they are quite expensive to create.

So my question applies now to clients in ES: are they expensive to create/destroy or, on the other hand, they are so light that I can create/destroy them as many times as I want in my application?

My application uses the Transport Client to send index/search requests to a remote ES server. And these requests' frequency can vary depending on products' catalogs availability, so it could be from several times a day to once a month for each catalog.

Thanks.

Thanks a lot for the prompt response.

I pressume this applies to any type of client, no matter whether this is
Transport, Node, Local, right?

On Fri, Feb 4, 2011 at 1:07 PM, Shay Banon shay.banon@elasticsearch.comwrote:

The client should be instantiated once and used throughout the lifecycle
of the application. Similar to Hibernate SeassionFactory.

On Friday, February 4, 2011 at 2:05 PM, Enrique Medina Montenegro wrote:

Hi,

Being used to working with Hibernate, for instance, I know that I shouldn't
be creating 'sessionFactory' instances happily, as they are quite expensive
to create.

So my question applies now to clients in ES: are they expensive to
create/destroy or, on the other hand, they are so light that I can
create/destroy them as many times as I want in my application?

My application uses the Transport Client to send index/search requests to a
remote ES server. And these requests' frequency can vary depending on
products' catalogs availability, so it could be from several times a day to
once a month for each catalog.

Thanks.

Yes.
On Friday, February 4, 2011 at 2:09 PM, Enrique Medina Montenegro wrote:

Thanks a lot for the prompt response.

I pressume this applies to any type of client, no matter whether this is Transport, Node, Local, right?

On Fri, Feb 4, 2011 at 1:07 PM, Shay Banon shay.banon@elasticsearch.com wrote:

The client should be instantiated once and used throughout the lifecycle of the application. Similar to Hibernate SeassionFactory.
On Friday, February 4, 2011 at 2:05 PM, Enrique Medina Montenegro wrote:

Hi,

Being used to working with Hibernate, for instance, I know that I shouldn't be creating 'sessionFactory' instances happily, as they are quite expensive to create.

So my question applies now to clients in ES: are they expensive to create/destroy or, on the other hand, they are so light that I can create/destroy them as many times as I want in my application?

My application uses the Transport Client to send index/search requests to a remote ES server. And these requests' frequency can vary depending on products' catalogs availability, so it could be from several times a day to once a month for each catalog.

Thanks.