gRPC fanout question

28 views
Skip to first unread message

Andres Morey

unread,
Sep 5, 2024, 1:35:24 AMSep 5
to grpc.io
Hi All,

I'm working on a Go library to send fanout queries to multiple gRPC servers simultanously and I'd love some feedback on the current implementation (currently Kubernetes-only):

Currently, the user creates a `Dispatcher` instance which maintains a ClientConn internally and monitors the Kubernetes API for new server ips in the background. When a new server comes online it updates the ClientConn's addresses using a custom resolver and also maintains a list of the ips locally. When a user initializes a fanout query it dispatches queries to all available ips, passing the target ip to a custom load balancer which then picks the SubConn corresponding to the target ip.

There's more to do to make the library production-ready but before investing more time into it I have some questions for the community:

1. Is fanout an anti-pattern in gRPC? I couldn't find any built-in tools in the Go library or 3rd party libraries which made me wary of using fanout to begin with.
2. Is it better to maintain one ClientConn with all available ips as SubConns or to maintain a separate ClientConn for each server?
3. Do you have any recommendations for how to improve the current implementation's API?

Thanks!

Reply all
Reply to author
Forward
0 new messages