liveBook · Manning

Load balancing

As explained in Refactoring to Rust

A load balancer is a system component that distributes incoming requests or tasks among multiple running service instances.

Load balancing distributes incoming calls or tasks among multiple running service processes. It becomes necessary when horizontal scaling adds more than one server or application instance. section 8.2

A balancer may alternate between services or inspect current load. Coordination must also prevent two processors from claiming the same task, using existing-record checks or in-process markers. section 8.2

Load balancing supports a scaling trade-off:

  • Horizontal scaling adds physical machines and uses load balancing and queues to distribute work, increasing monetary cost. section 8.2
  • Vertical scaling adds resources to existing hardware and divides work among processes, avoiding additional machines but requiring work partitioning. section 8.2

How Refactoring to Rust covers it

How deep it goes
Defines distribution logic and duplicate-work safeguards, but defers detailed implementation as an architectural concern.
Examples
Uses two background Python processes and contrasts distributing work across servers with adding resources to one machine.
What it assumes
Assumes familiarity with running processes and introduces horizontal scaling before explaining service coordination.
What you can do after
Evaluate when distributing work across servers fits better than adding resources to existing hardware.
How it connects
Connects horizontal scaling with queues, vertical scaling, routing, process coordination, and task ownership.

Also explained in

Compare how 13 books explain load balancing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Refactoring to Rust. The section links point to the parts of the book it draws on.