mirror of
https://github.com/ByteByteGoHq/system-design-101.git
synced 2026-04-06 10:17:24 -04:00
This PR adds all the guides from [Visual Guides](https://bytebytego.com/guides/) section on bytebytego to the repository with proper links. - [x] Markdown files for guides and categories are placed inside `data/guides` and `data/categories` - [x] Guide links in readme are auto-generated using `scripts/readme.ts`. Everytime you run the script `npm run update-readme`, it reads the categories and guides from the above mentioned folders, generate production links for guides and categories and populate the table of content in the readme. This ensures that any future guides and categories will automatically get added to the readme. - [x] Sorting inside the readme matches the actual category and guides sorting on production
45 lines
1.4 KiB
Markdown
45 lines
1.4 KiB
Markdown
---
|
||
title: "Top 6 Load Balancing Algorithms"
|
||
description: "Explore the top 6 load balancing algorithms in detail."
|
||
image: "https://assets.bytebytego.com/diagrams/0251-lb-algorithms.png"
|
||
createdAt: "2024-03-05"
|
||
draft: false
|
||
categories:
|
||
- software-development
|
||
tags:
|
||
- "Load Balancing"
|
||
- "Algorithms"
|
||
---
|
||
|
||

|
||
|
||
## Top 6 Load Balancing Algorithms
|
||
|
||
* **Static Algorithms**
|
||
|
||
* Round robin
|
||
|
||
The client requests are sent to different service instances in sequential order. The services are usually required to be stateless.
|
||
|
||
* Sticky round-robin
|
||
|
||
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.
|
||
|
||
* Weighted round-robin
|
||
|
||
The admin can specify the weight for each service. The ones with a higher weight handle more requests than others.
|
||
|
||
* 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**
|
||
|
||
* Least connections
|
||
|
||
A new request is sent to the service instance with the least concurrent connections.
|
||
|
||
* Least response time
|
||
|
||
A new request is sent to the service instance with the fastest response time.
|