Client-side load balancing with gRPC
Client-side load balancing is similar in principle to the example that we previously looked at. This is where the client decides which server endpoints to connect to. Then, client-side gRPC middleware connects to those endpoints directly.
gRPC .NET libraries have inbuilt components that enable client-side load balancing. But, at the time of writing, those are only available in preview. Therefore, we need to update one of our NuGet packages to a prerelease version.
The caveat is that the specific code implementations may change once the feature is fully released. But even if this happens, the principles of applying it will remain the same.
Updating the NuGet package
All the client-side load balancing components are available in the Grpc.Net.Client
NuGet package, but they are only available in the package versions that have a pre-release tag. However, since by default the dotnet
CLI command will apply the latest full-release version, we...