How does the dgraph client handle the request to the multiple servers?

Suppose you have registered multiple DgraphClientStub for one DgraphClient. I want to know how does the client send the request to these servers? Does the client send same request for all of the servers at the same time? I there a documentation about this type of questions?

No client will send a request for which they don’t know the address.

After hitting a server, Dgraph will “spread” the request via Zero instance to the respective Alphas who have the requested data.

If you concentrate all clients on a single Alpha, this could be bad in the long run. I would recommend a balance in front of those instances.

1 Like

With the official clients, when you pass multiple stubs, the client picks a random connection to send the request to, giving you a random-based load-balancing behavior.


Thank you so much. Now I understand.