Interview knowledge

Load Balancer

Establishedest.Started 30 Aug 20261 min read#system-design#engineering

Inspired by Google system design interview: Design Spotify (with ex-Google EM)

Where it sits: Load balancer

Single point of contact for user requests.
It does health checks for all servers to know if some have issues.
Distribution:
- Round Robin: simple and sequential
- IP hashing: allows the same user to go to the same server
- Least connections: uses servers that have more capacities first

If you have a single load balancer, then you've created a single point of failure again.
There is usually at least one passive load balancer that can take over if the active one fails (todo something something active/passive replication)

They do health checks to servers to know if they can use them.

Benefits

  • services do not have to worry about customer facing issues (rate limiting, https)

Metrics to split requests

Could be metrics to handle scalability and how many servers are needed too.

  • open connections
  • CPU
    CPU is not often a good one, depending on the service, especially if it's mostly waiting on a database for example

Sources