Top 6 Load Balancing Algorithms Every Developer Should Know

preview_player
Показать описание

Animation tools: Adobe Illustrator and After Effects.

Checkout our bestselling System Design Interview books:

ABOUT US:
Covering topics and trends in large-scale system design, from the authors of the best-selling System Design Interview series.
Рекомендации по теме
Комментарии
Автор

When using dynamic load balancing, especially with a feedback loop (e.g. dynamic weights updated based on some server-side metric), you probably want some static guard rails to keep imbalance under control in case something unexpected happens (e.g. a sudden hot spot).

Also, it's worth looking for the possibility of positive feedback loops, for instance if certain kinds of errors happening on one particular server (e.g. configuration problem) make processing very fast, and thus make this server even more attractive to the load balancing system.

Error metrics are easily overlooked when computing weights for load balancing.

jmsaffroy
Автор

I am a product manager in payments domain, this video is very Useful and easily covered my my need of the hour

kannanbabu
Автор

I;ve just finished to "warm up" load balancing section before intervview and at the end get your vid!:)

ordkngr
Автор

Hi! You've excellent stuff on your channel. Thanks a tonne for sharing 🙏✌🏻

gagAMinute
Автор

When I first heard of load balancing I imagined the round robin algorithm like distributing cards to all the players in the game. I didn't even think there are algorithms on distributing the load

adityaanuragi
Автор

great content thank you for all information.

alqassemnasr
Автор

can u explain about concurrency and redundancy problems when using multiple servers?
for example should we have a separate copy of the application on each server or there are other ways for doing it?
another consideration is concurrent access to shared resources... how preventing conflicts and data corruption is implemented?
probably another subcategory is distributing the database itself...
i think these can be candidates for separate videos indeed ;)

kjyu
Автор

ChatGPT responses with a bit different algorithms, less Round Robins and more Least Connections:
1. Round Robin
2. Least Connections
3. Weighted Round Robin
4. Weighted Least Connections
5. IP Hash
6. Least Response Time

Bard responses with a bit different algorithms, Geolocation instead of IP Hash:
1. Round robin.
2. Weighted round robin.
3. Least connections.
4. Least response time.
5. Sticky sessions.
6. Geolocation.

:D

solution-n-social
Автор

🎯 Key Takeaways for quick navigation:

00:07 🌐 *Overview of Load Balancing Algorithms*
- Crucial for large-scale web apps.
- Two categories: static and dynamic.
- Goal: Grasp core load balancing for better app architecture.
01:07 🔄 *Static Load Balancing Algorithms*
- Distribute requests without real-time server consideration.
- Examples: Round Robin, Sticky Round Robin, Weighted Round Robin.
- Trade-off: Simplicity vs. Adaptability.
02:37 🔍 *Hash-Based Algorithms*
- Hash functions map requests to servers.
- Challenge: Optimal hash function choice.
- Advantage: Even distribution with a wise function.
03:11 🔄 *Dynamic Load Balancing Algorithms*
- Adapt in real-time based on server conditions.
- Examples: Least Connections, Least Response Time.
- Trade-off: Adaptability vs. Overhead.
04:13 ⚖️ *Trade-offs between Static and Dynamic Algorithms*
- Consider trade-offs in load balancing selection.
- Static for stateless apps, dynamic for complex ones.
04:44 💬 *Viewer Engagement and Conclusion*
- Encourage sharing load balancing experiences.
- Highlight simplified "static" and "dynamic" differentiation.
- Promote system design newsletter.

Made with HARPA AI

jks
Автор

you miss random load balancing. it is similar to round robin, except uses random function e.g. something like rand(0, 256) % 4.
DNS supports that.

nmmm
Автор

Hi, your videos are too low in volumn I need to increase it too full for clear but when switch tab next YT video it'll be too loud. So it for all the end users or only for my system. But your videos are very informative thanks for that.

fullStackInKannada
Автор

Is Load Balancing a good defence against a DDOS?

• If it's a high volume lightweight attack like a Smurfed ping won't the load balancer need to process each packet anyway, even if very briefly?
• Under what circumstances will trivial processing overwhelm the load balancer and is this different between algorithms?
• I'm assuming Sticky Round Robin or IP/URL can just drop all the packets from a user or IP respectively to dodge a denial of service attack. Is this the case?
• How are TCP/IP layers split between the load balancer and the destination machine? Particularly, if an attacker sends massage parts at a rate just under the connection timeout will the load balancer get overwhelmed by excessive open connections or will the destination machine (slow loris attack)?

PatrickStaight
Автор

Summary:-
Static - doesn't consider server real time connections, performance and metrics
Dynamic -> Consider performance and metrics


Static :-

1) Round Robin -> Sends request in the round robin fashion
2) Sticky Round Robin -> Sends subsequent request of the same user to the same server. All related data on the same server.
3) Weighted Round Robin -> Assigns weights to the servers. Sends more requests to the server with more weight
4) IP/Hash -> Calculates the hash and sends request.(can generate evenly distributed load based on the hash function).

Dynamic:-

1) Least Connections -> Sends requests to the server with least connections.
2) Least time -> Sends requests to the server with current low latency and faster response time.

priyankasetiya
Автор

Looks like there is an error on preview in 2. No Bob's requests on the right side, only on the left.

eyswwxe
Автор

Surely there has to be hybrid solutions to this problem. Some of these details in the "cons" category for these different methods feel like they could be easily overcome. #3 for example - why would an admin be required to actively monitor these values and adjust them? Surely that task could be automated with code.

ryan_roga
Автор

Hey, I'm new to System design, Can we add multiple load balancers in a complex system? if yes then how to map requests between them? Do we need another load balancer to manage those two?

sham-yaswanth
Автор

Is it possible one request share with multiple server using least connection and duplicate occurrence?

jn
Автор

I've seen a lot of load balancing configurations in my time, but I don't think I have ever seen anyone use URL hashing. Wonder what scenario that is good for.

Tony-dprl
Автор

How do you scale the load balancer? How do you prevent the load balancer from being a single point of failure?

robl
Автор

What load balancing method is suitable for Backends such as Nodejs used for Live Streaming Applications?

*So the Backend is a live streaming application

fazlurrahmatullah