mirror of
https://github.com/ByteByteGoHq/system-design-101.git
synced 2026-04-22 00:37:24 -04:00
Add ordered lists number for 6 common load-balancing algorithms (#6)
This commit is contained in:
33
README.md
33
README.md
@@ -422,24 +422,31 @@ The diagram below shows 6 common algorithms.
|
|||||||
|
|
||||||
- Static Algorithms
|
- Static Algorithms
|
||||||
|
|
||||||
1. Round robin
|
1. Round robin
|
||||||
The client requests are sent to different service instances in sequential order. The services are usually required to be stateless.
|
|
||||||
|
|
||||||
2. Sticky round-robin
|
The client requests are sent to different service instances in sequential order. The services are usually required to be stateless.
|
||||||
This is an improvement of the round-robin algorithm. If Alice’s first request goes to service A, the following requests go to service A as well.
|
|
||||||
|
|
||||||
3. Weighted round-robin
|
3. Sticky round-robin
|
||||||
The admin can specify the weight for each service. The ones with a higher weight handle more requests than others.
|
|
||||||
|
|
||||||
4. Hash
|
This is an improvement of the round-robin algorithm. If Alice’s first request goes to service A, the following requests go to service A as well.
|
||||||
This algorithm applies a hash function on the incoming requests’ IP or URL. The requests are routed to relevant instances based on the hash function result.
|
|
||||||
|
|
||||||
Dynamic Algorithms
|
4. Weighted round-robin
|
||||||
Least connections
|
|
||||||
A new request is sent to the service instance with the least concurrent connections.
|
|
||||||
|
|
||||||
Least response time
|
The admin can specify the weight for each service. The ones with a higher weight handle more requests than others.
|
||||||
A new request is sent to the service instance with the fastest response time.
|
|
||||||
|
6. Hash
|
||||||
|
|
||||||
|
This algorithm applies a hash function on the incoming requests’ IP or URL. The requests are routed to relevant instances based on the hash function result.
|
||||||
|
|
||||||
|
- Dynamic Algorithms
|
||||||
|
|
||||||
|
5. Least connections
|
||||||
|
|
||||||
|
A new request is sent to the service instance with the least concurrent connections.
|
||||||
|
|
||||||
|
7. Least response time
|
||||||
|
|
||||||
|
A new request is sent to the service instance with the fastest response time.
|
||||||
|
|
||||||
### URL, URI, URN - Do you know the differences?
|
### URL, URI, URN - Do you know the differences?
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user