Load balancing web traffic: what and how?
What is load balancing?
Load balancing is used to improve the performance and reliability of websites, applications, databases and other services by distributing the workload of the servers.
A single point of failure can be mitigated by introducing a load balancer and at least one extra web server on the backend.
This is what a your server infrastructure might look like without a load balancer.
This is what a the same infrastructure might look like with a load balancer implemented.
The convenience of load balancing web traffic
It is known that there is only so much processing power, memory, and disk space associated with a single server. Whereas hosting on more than one server enables you to distribute the load so that no single server is ever overwhelmed.
A substantial effect on a website’s performance is the amount of traffic it receives. Load balancing gives you the tools to handle the majority of large spikes in traffic by redirecting the traffic across multiple servers. If you are expecting a large spike in traffic, just spin up a few more webservers and simply add them to the balance pool!
In the circumstances where a company has scheduled downtime or server maintenance windows a load balancer can eliminate the downtime by channeling the traffic to other resources, thus allowing for maintenance on a server without impacting users.
When using multiple datacentres across different cloud providers, the load balancer can prevent failures by redistributing the resources to unaffected areas with little disruption.
Running only a single Load Balancer means that you still have a single point of failure. To avoid this, we recommend running them in pairs so that if one load balancer were to fail, the slack will be picked up by your secondary balancer.
What Is Layer 7 Load Balancing?
Layer 7 load balancing acts at the high-level application layer and routes traffic in a more advanced way than layer 4 load balancing. A layer 7 balancer terminates traffic and reads the message within. It then makes a routing decision based on the content of the data (URL or cookies are examples) and opens a new connection to the correct webserver.