System Design Basics

Load Balancing

Load Balancer(LB) is a critical component of any distributed system. It helps to spread the traffic across a cluster of servers to improve responsiveness and availability of applications, websites or databases. LB also keeps track of all the resources while distributing requests. If a server is not available to take new requests of is not responding or has elevated error rate, LB will stop spending traffic to such a server.

  • Between the user and the web server
  • Between web servers and an internal platform layer, like application servers or cache servers
  • Between internal platform layers and database

Benefits of Load Balancing

  • User experience faster, uninterrupted service.
  • Service providers experience less downtime and higher throughput
  • Smart load balancers provide benefits like predictive analytics that determine bottlenecks before they happen.
  • System administrators experience fewer failed or stressed components.

Load Balancing Algorithms

Load balancers consider two factors before forwarding a request to a backend server. they will first ensure that the server is responding appropriately to requests. Then they use a pre-configured algorithm to select one from those healthy servers.

  • Least Connection Method
  • Least Response Time Method
  • Least Bandwidth Method
  • Round Robin Method
  • Weighted Round Robin Method
  • IP Hash

Redundant Load Balancers

The load balancer can be single point of failure, to overcome this, a second load balancer can be connected to the first to form a cluster. Each LB monitors the health of the other and, since both of them are equally capable of serving traffic and failure detection, in the event the main load balancer fails, the second load balancer takes over.

Caching

Load balancing helps you scale horizontally across an ever-increasing number of servers, but caching will enable you to make better use of the resources you already have as well as making otherwise unattainable product requirements feasible……

Data Partitioning

Data partitioning is a technique to break a big database into many smaller parts.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store