Grpc-go: Is balancer api v2 stable?

Created on 16 Oct 2017  路  5Comments  路  Source: grpc/grpc-go

I'm trying to write a client-side load balancer for gRPC, but in current version of docs it's a little bit confusing:

  1. grpc.WithBalancer marked as deprecated with a comment "use grpc/balancer pkg instead"
  2. "grpc/balancer" have almost no documentation about how to use it. And also marked as "Experimental"
  3. grpc.WithBalancerBuilder marked as "is for testing only."with a suggestion to use ServiceConfig.
  4. ServiceInfo struct marked as "This is EXPERIMENTAL and subject to change."

I'm confused about what should I use.

Question

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.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.

All 5 comments

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?

@xiang90 You can send comments to the discussion link for the gRFC. Or simply file an issue in our repo.

@Civil Yes.

Closing this issue. Please track the process in #1388.

Was this page helpful?
0 / 5 - 0 ratings