← Lessons

quiz vs the machine

Platinum1750

Networking

The gRPC Load Balancing

Spreading long lived calls across many backends.

5 min read · advanced · beat Platinum to climb

A Connection Problem

gRPC runs over a long lived HTTP version two connection. A simple network load balancer sees one connection and pins all calls to one backend, which defeats balancing.

Two Ways To Balance

Because connections are sticky, gRPC needs balancing that understands individual calls.

  • Client side balancing lets the client know all backend addresses and pick one per call, often round robin.
  • Proxy balancing uses a smart proxy that understands gRPC and spreads calls across backends.

Why Discovery Matters

Either approach needs a way to learn the current set of healthy backends.

  • A name resolver turns a service name into a list of addresses.
  • A balancing policy chooses among those addresses per call.
  • Backends that fail health checks are removed from the pool.

Client side balancing avoids an extra hop but pushes discovery logic into every client. A proxy centralizes that logic at the cost of one more network hop. The right choice depends on how much you want clients to know about your topology.

Key idea

Because gRPC pins calls to long lived connections, balancing must work per call through client side policies or a gRPC aware proxy, both relying on name resolution to track the healthy backend pool.

Check yourself

Answer to earn rating on the learn ladder.

1. Why does a plain connection level balancer fail for gRPC?

2. What does client side load balancing require?

3. What is a cost of using a balancing proxy?