Skip to main content

What is load balancing (load balancing)?

Load balancing is a mechanism that evenly spreads incoming requests across several servers so a system runs faster, more stably, and without overload.

How it works

When a database (or web application) receives a flood of requests, the load balancer decides which server to route each one to. It can take into account:

  • the current number of active connections,
  • response time,
  • the user's location,
  • priority server roles (e.g. master / replicas).

The main goals

  1. Even load. No single server gets swamped with requests.
  2. Fault tolerance. If one server goes down, requests get redirected to others.
  3. Scalability. New servers can be added without stopping the system.

Examples of balancing algorithms

  • Round Robin. Requests get distributed in turn.
  • Least Connections. Goes to the server with the fewest active connections.
  • IP Hash. A user always lands on the same server, based on a hash of their IP.

Summary: Load balancing is a "traffic distributor" that makes sure a system's resources are used efficiently and that users don't experience overloads or downtime.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.