Connection pooling for Dgraph

Posted by piyushGoyal2:

This is more of a query. I understand that a client can be created by passing as many servers which are part of cluster. But this would generate a single client with connections to the n number of servers configured.
Like in a traditional database system where in a connection pool exist with already an n number of connections already open and client hiding those details and providing a free connection, does the similar philosophy also applies for a dgraph.
If yes does dgraph recommend a way to implement it?
If no does that mean there is always and always a single connection open between the client and the database? Also isn’t that a problem?

manishrjain commented :

In Dgraph, you form the connections and pass a working connection (or multiple) to the client library. Dgraph itself doesn’t do any connection pooling or anything else.

When you give it a bunch of connections, it would choose one at random and send the query using that.

piyushGoyal2 commented :

Hi @manishrjain
Thanks for the response. Does that mean if there are 3 servers at a time forming a DGraph cluster, I have mention all those server/node’s IP in my code configuration in order to create 3 DgraphGrpc.DgraphBlockingStub objects? Also, does that mean that the client will spawn only 3 connections with Dgraph cluster?
Also, if I want to increase or decrease DGraph nodes in a cluster in future, do I have to change my application configuration everytime to accommodate new added/deleted node or DGraph handles it by its own? If yes, how are the things internally done? Can you please point me to the correct documentation?

piyushGoyal2 commented :

May be not right place for this kind of discussion. Moving the question to discuss forum.
Thanks Manish.