I'm trying to write a client-side load balancer for gRPC, but in current version of docs it's a little bit confusing:
I'm confused about what should I use.
The new balancer APIs are in progress (#1388).
There are multiple pending PRs (including #1515, #1551 and #1558) in review.
Eventually, users should use service config to pick the balancer to use. But as the work to support service config is still in progress, there needs to be some way to test balancer implementations. And that's what grpc.WithBalancerBuilder is for.
We don't want users to use this in production (because there should be a way for service owners to switch balancer for its clients), so it's marked as testing only.
We expect this new balancer APIs to be stable, but we will still mark it as "EXPERIMENTAL" for some time before we are confident enough.
As for what you should use right now:
Please use the new balancer APIs as in the balancer package. The roundrobin implementation and test can work as an example of how to do it right now.
one related question: how should we provide feedbacks on the new balancer API?
Am I right that currently specifying balancer with "ServiceConfig" is not implemented and for now I should use "WithBalancerBuilder" with the aim to switch to ServiceConfig as soon as corresponding PRs will be merged?
Closing this issue. Please track the process in #1388.
Most helpful comment
The new balancer APIs are in progress (#1388).
There are multiple pending PRs (including #1515, #1551 and #1558) in review.
Eventually, users should use service config to pick the balancer to use. But as the work to support service config is still in progress, there needs to be some way to test balancer implementations. And that's what
grpc.WithBalancerBuilderis for.We don't want users to use this in production (because there should be a way for service owners to switch balancer for its clients), so it's marked as testing only.
We expect this new balancer APIs to be stable, but we will still mark it as "EXPERIMENTAL" for some time before we are confident enough.
As for what you should use right now:
Please use the new balancer APIs as in the
balancerpackage. Theroundrobinimplementation and test can work as an example of how to do it right now.