Please enable JavaScript.
Coggle requires JavaScript to display documents.
Load Balancing (LB) - Coggle Diagram
Load Balancing (LB)
Types of Load Balancers
- Layer 4 (Up To Transport Layer)
Low level protocol, less resources needed, faster, better performance, access to TCP/ UDP, IP, port
- Layer 7 (Up To Application Layer)
High level protocol, needs more resources, advanced tunnig and customization, setup can be based on content type and headers, cookies, payload (data), has also access to Level 4 properties
-
How does it work?
LB runs reverse proxy software, that serves the purpose
What is Reverse Proxy Server?
A reverse proxy server is a type of proxy server that typically sits behind the firewall in a private network and directs client requests to the appropriate backend server. A reverse proxy provides an additional level of abstraction and control to ensure the smooth flow of network traffic between clients and servers.
(Forward) Proxy vs Reverse Proxy
The Forward Proxy routes traffic between clients and (usually external) system. It allows to apply additional policies and restrictions.
The reverse proxy is a proxy server that accepts a request from a client, forwards the request to another one of many other servers, and returns the results from the server that actually processed the request to the client as if the proxy server had processed the request itself. The client only communicates directly with the reverse proxy server and it does not know that some other server actually processed its request.
Pros & Cons of LB
Pros
- Scalability
The system is horizontally scalable - you can add more instances when needed (to handle more requests)
- Resilience
The system is more resilient (if a server behind LB fails, the other servers will handle the requests)
Cons
- Increased Complexity (More configurations)
DEFINITION:
Load Balancer is a machine, that works as a reverse proxy. They are usually set up in pairs in case one of them fails, the other one takes it's place
PURPOSE:
To distribute the requests to multiple servers that host the actual application/ service in order to improve scalability
STRATEGIES for distributing requests:
- Round Robin (most popular): rotates all in specific order like 1, 2, 3, 1, ...
- Resource-based
- Connection-based
- Random
- etc
-