Тёмный

Top 6 Load Balancing Algorithms Every Developer Should Know 

ByteByteGo
Подписаться 897 тыс.
Просмотров 109 тыс.
50% 1

Get a Free System Design PDF with 158 pages by subscribing to our weekly newsletter: bytebytego.ck.page/subscribe
Animation tools: Adobe Illustrator and After Effects.
Checkout our bestselling System Design Interview books:
Volume 1: amzn.to/3Ou7gkd
Volume 2: amzn.to/3HqGozy
The digital version of System Design Interview books: bit.ly/3mlDSk9
ABOUT US:
Covering topics and trends in large-scale system design, from the authors of the best-selling System Design Interview series.

Опубликовано:

 

16 авг 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 59   
@jmsaffroy
@jmsaffroy 11 месяцев назад
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.
@chakibbensari1850
@chakibbensari1850 9 месяцев назад
Good point. But i think a server with multiple errors should be monitored and fixed thus, it should not keep running with errors for a while..
@andrewventer9166
@andrewventer9166 11 месяцев назад
You make amazing content. Keep it up!
@chieeyeoh6204
@chieeyeoh6204 11 месяцев назад
You make it so simple to understand
@gagAMinute
@gagAMinute 11 месяцев назад
Hi! You've excellent stuff on your channel. Thanks a tonne for sharing 🙏✌🏻
@adityaanuragi6916
@adityaanuragi6916 11 месяцев назад
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
@user-or9dk4ng8r
@user-or9dk4ng8r 11 месяцев назад
I;ve just finished to "warm up" load balancing section before intervview and at the end get your vid!:)
@amanuel2135
@amanuel2135 11 месяцев назад
This channel is a gem 💎
@VanNguyen-qn6ci
@VanNguyen-qn6ci 11 месяцев назад
best channel for fresher developer !
@solution-n-social
@solution-n-social 11 месяцев назад
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
@LuvxJacqu4li8e
@LuvxJacqu4li8e 6 месяцев назад
Thanks I was looking for this video.
@kannanbabu5086
@kannanbabu5086 14 дней назад
I am a product manager in payments domain, this video is very Useful and easily covered my my need of the hour
@jks6371
@jks6371 7 месяцев назад
🎯 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
@alqassemnasr2864
@alqassemnasr2864 11 месяцев назад
great content thank you for all information.
@viktoreidrien7110
@viktoreidrien7110 11 месяцев назад
thank you very much !!!
@kjyu4539
@kjyu4539 11 месяцев назад
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 ;)
@nmmm2000
@nmmm2000 11 месяцев назад
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.
@vishalchoubey5606
@vishalchoubey5606 9 месяцев назад
Rather use consistent hashing :`}
@nmmm2000
@nmmm2000 9 месяцев назад
​@@vishalchoubey5606 random is different from consistent hashing.Consistent hashing will always send specific request to specific backends. I don't think this is good in case of load balancer. Let suppose we have problematic "page", it will always be send to one and same backed. Let also suppose we have viral "page", it will always be send to one and same backed. Then the backend will die.
@PatrickStaight
@PatrickStaight 11 месяцев назад
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)?
@KingMikolaj
@KingMikolaj 8 месяцев назад
your load balancer reverse proxy is simply a way to distribute requests to different services. For example if you do not have rate limiting in place to stop one client from requesting to much to the load balancer it didn't really do all that much to defend against the ddos other than effectively distributing the load to be able to handle more requests.
@PatrickStaight
@PatrickStaight 8 месяцев назад
@@KingMikolaj I spent a while thinking of that comment 3 months ago. I'm glad someone finally responded to it. It feels like you are saying a load balancer is completely useless in mitigating a DDOS attack. You seem to be saying that a load balancer can only be used to distribute requests among services. I have never owned or implemented a load balancer but I feel this is not the case. Why would we need to distribute requests if not to keep a server from getting overloaded?
@LearnToCode
@LearnToCode 6 месяцев назад
@@PatrickStaightI understand it this way: to some extent a load balancer of course may help servers not to be overloaded, evenly distributing ddos (i.e. very frequent) requests among the servers. but at some point servers will not be able to process such a big number of incoming requests - again, they are evenly loaded with the help of our load balancer. in order system not to fail, we need to implement something else - not only a load balancer. we need somehow to detect that someone sends too many requests and stop processing or limit them
@rbelatamas
@rbelatamas 11 месяцев назад
thanks 🎉❤
@ayed-al-nator
@ayed-al-nator 11 месяцев назад
Thx ❤
@fullStackInKannada
@fullStackInKannada 11 месяцев назад
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.
@priyankasetiya1358
@priyankasetiya1358 Месяц назад
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.
@ryan_roga
@ryan_roga 11 месяцев назад
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.
@sham-yaswanth
@sham-yaswanth 11 месяцев назад
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?
@mastershifu6906
@mastershifu6906 11 месяцев назад
Geo DNS may help you
@AbeDillon
@AbeDillon 11 месяцев назад
The lowest latency method shouldn't require *that much* overhead, right? If you have enough traffic that you're tracking multiple outstanding requests per server, then you can order each server by whichever is longest: the latency of the last fulfilled request or the elapsed time since the oldest outstanding request. That way, you (practically) don't have any overhead measuring latency. If you don't have enough traffic to accumulate multiple requests per server, then load-balancing shouldn't be a huge problem. You can add more complex logic to minimize hot-spots and detect server failures, but the gist is still the same.
@chakibbensari1850
@chakibbensari1850 9 месяцев назад
I think dynamic latency algorithm is complex because you should take in account each specific request.. example, a get request that fetchs a resource from a remote server should not have the same weight as a post request that create a resource with the use of a remote external api..
@user-ey2sw8wx7e
@user-ey2sw8wx7e 11 месяцев назад
Looks like there is an error on preview in 2. No Bob's requests on the right side, only on the left.
@robl39
@robl39 11 месяцев назад
How do you scale the load balancer? How do you prevent the load balancer from being a single point of failure?
@sealoftime
@sealoftime 11 месяцев назад
You load balance the load balancer! Via DNS-based load balancing
@m_sen8710
@m_sen8710 11 месяцев назад
you add another one and use Keepalived to link them both
@fazlurrahmatullah3017
@fazlurrahmatullah3017 9 месяцев назад
What load balancing method is suitable for Backends such as Nodejs used for Live Streaming Applications? *So the Backend is a live streaming application
@Tony-dp1rl
@Tony-dp1rl 11 месяцев назад
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.
@robpearce
@robpearce 7 месяцев назад
url hashing lends towards session affinity, or if one of your serving servers is in a different security tier/domain than the others. It lets you serve that secure content from a one or a subset of your fleet. It also shows up in microservices here and there.
@thegtrick359
@thegtrick359 8 месяцев назад
Hello everyone, I am working on load balancing algorithm in CloudSim 3.0.3 and main problem is deadline of task. If I have MIPS that can not execute this task before deadline, what I need to do? Can anyone help me?
@HimalayJoriwal
@HimalayJoriwal 3 месяца назад
Consistent hashing is widely used. Isn't it ?
@darenzou
@darenzou 11 месяцев назад
is consistent hashing considered a load balancing algorithm?
@POM4R4NC
@POM4R4NC 11 месяцев назад
It can be used as a part of it.
@rabbit.d3v
@rabbit.d3v 2 дня назад
But this work only to application with the big infraestructure or not?
@fanjin
@fanjin 11 месяцев назад
If the load balancer is a single server with single IP address, how can it possibly handle so much traffic? I know it just forwards request but the IO overhead can add up, right?
@brandoncortes9655
@brandoncortes9655 11 месяцев назад
Deberias replicar el servidor con alguna tecnologia como docker para tener mas y mas sevidores desplegados horizontalmente en contenedores cuando se alcance el limite asignado para cada uno. Si solo hacer depender a tu app de 1 servidor y este no esta manejado por alguna tecnologia de reemplazo de contenedores como kubernetes es muy posible que tu servidor falle cuando tu app vaya escalando :(
@blue5659
@blue5659 11 месяцев назад
Is it better to avoid load balancers entirely and use message queues instead?
@robpearce
@robpearce 7 месяцев назад
Different purposes. Message queues address communications (typically within) a system. Load balancers address network traffic.
@jn0322
@jn0322 2 месяца назад
Is it possible one request share with multiple server using least connection and duplicate occurrence?
@k.alipardhan6957
@k.alipardhan6957 7 месяцев назад
If you already have latency metrics, wouldn't least time be the "best" choice?
@dellikbabu81
@dellikbabu81 11 месяцев назад
What about topo based algorithm
@BhaveshAgarwal
@BhaveshAgarwal 11 месяцев назад
ByteByteGo - please please share the tools and softwares you use to create these wonderful videos. It will be extremely helpful to learn them and use it for work and share knowledge in general. Thanks in advance!
@hlubradio2318
@hlubradio2318 15 дней назад
I studied queing theory in college. This is it. M N queues
@TheYeti
@TheYeti 11 месяцев назад
Do most devs using any cloud hosting even need to concern themselves with load balancing algos?
@Devertelo
@Devertelo 11 месяцев назад
When you see a video that says "Every Developer Should Know" and you look like John Snow, know nothing 😅
@JATINDER01992
@JATINDER01992 11 месяцев назад
Insert cookie with least connection
@zixuanzhao6043
@zixuanzhao6043 3 месяца назад
what about least errors
@CandyLemon36
@CandyLemon36 8 месяцев назад
The narrative here is powerful and impactful. A similar book I read was transformative in its reach. "Game Theory and the Pursuit of Algorithmic Fairness" by Jack Frostwell
@bouzie8000
@bouzie8000 5 месяцев назад
Me after watching a 20 minute video on consistent hashing and seeing none of it here :)
Далее
Proxy vs Reverse Proxy (Real-world Examples)
5:17
Просмотров 535 тыс.
System Design Interview: A Step-By-Step Guide
9:54
Просмотров 635 тыс.
ЮТУБ БЛОКИРУЮТ?
02:04
Просмотров 637 тыс.
Schoolboy - Часть 2
00:12
Просмотров 4,5 млн
8 Design Patterns EVERY Developer Should Know
9:47
What is a Load Balancer?
8:22
Просмотров 228 тыс.
Top 5 Redis Use Cases
6:28
Просмотров 174 тыс.
What Is A CDN? How Does It Work?
4:24
Просмотров 213 тыс.
Consistent Hashing | Algorithms You Should Know #1
8:04
The Story of Next.js
12:13
Просмотров 560 тыс.
How to build a Recursive React Component
21:16
Просмотров 33 тыс.
ЮТУБ БЛОКИРУЮТ?
02:04
Просмотров 637 тыс.