Scoped vs Singleton ignite client node in .net web api

classic Classic list List threaded Threaded
3 messages Options
martynas martynas
Reply | Threaded
Open this post in threaded view
|

Scoped vs Singleton ignite client node in .net web api

I am try planning to introduce Apache Ignite into existing old .net web api
project to use it as key/value store for detecting duplicate requests sent
to the load balanced api.

I would like to introduce minimum overhead to each request.

As I understand Client node is communicating to the server through TCP.

My current go to plan is to create a singleton object which will establish
connection to the remote cache and register it in my DI container.

Is it ok to leave node running and TCP connection open or should make the
ignite object scoped to start close on each request/response cycle?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
aealexsandrov aealexsandrov
Reply | Threaded
Open this post in threaded view
|

Re: Scoped vs Singleton ignite client node in .net web api

Hi,

Generally, you should have a working Ignite cluster somewhere that will
store and process your requests.

I am not sure that you really require the client node in your case. It will
use additional memory and CPU.

You can use several ways to work with Ignite cluster without fat client
node:

1)Thin clients (ODBC/JDBC) - you may store the connection open but it could
be closed. So you can try to use some connection pull.

https://apacheignite.readme.io/docs/thin-clients

2)REST - just open the connection and do some operations. Also could be
timed out. So you could open a new connection for every update.

BR,
Andrei

https://apacheignite.readme.io/docs/rest-api



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ptupitsyn ptupitsyn
Reply | Threaded
Open this post in threaded view
|

Re: Scoped vs Singleton ignite client node in .net web api


In short, use Singleton, because "Thick" client is heavy and thread-safe.

On Wed, Dec 19, 2018 at 5:28 PM aealexsandrov <[hidden email]> wrote:
Hi,

Generally, you should have a working Ignite cluster somewhere that will
store and process your requests.

I am not sure that you really require the client node in your case. It will
use additional memory and CPU.

You can use several ways to work with Ignite cluster without fat client
node:

1)Thin clients (ODBC/JDBC) - you may store the connection open but it could
be closed. So you can try to use some connection pull.

https://apacheignite.readme.io/docs/thin-clients

2)REST - just open the connection and do some operations. Also could be
timed out. So you could open a new connection for every update.

BR,
Andrei

https://apacheignite.readme.io/docs/rest-api



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