Moving from Issues page of DGraph4J.
Initial Question: Hi
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?
Response From Manish:
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.
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 every time 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?