Three Load-Balancing Strategies

Distributed Services with Go — by Travis Jeffery (62 / 84)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Chapter 9 Discover Servers and Load Balance from the Client | TOC | Load Balance on the Client in gRPC 👉

Three strategies can be used for solving the discovery and load balancing problem:

  • Server proxying — your client sends its requests to a load balancer that knows the servers (either by querying a service registry or by being the service registry) and proxies the requests to your back-end services.
  • External load balancing — your client queries an external load-balancing service that knows the servers and tells the client which server to send the RPC.
  • Client-side balancing — your client queries a service registry to learn about the servers, picks the server to send its RPC, and sends its RPC directly to the server.

Using a server proxy is the most commonly used discovery and load-balancing pattern. Most servers don’t trust their clients enough to give them control over how load balancing works because these decisions might affect the service’s availability (for example, allowing a client to target a single server and call it until it’s unavailable). You can put a proxy between clients and servers to act as a trust boundary. The proxy lets you control how your system ingests requests, as all the networking behind the proxy is in your network, trusted, and under your control. The server proxy knows about the servers it proxies to…

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.