What is LOAD BALANCING? ⚖️

  Рет қаралды 938,120

Gaurav Sen

Gaurav Sen

Күн бұрын

Load Balancing is a key concept in system design. One simple way would be hashing all requests and then sending them to the assigned server.
The standard way to hash objects is to map them to a search space and then transfer the load to the mapped computer. A system using this policy is likely to suffer when new nodes are added or removed from it.
One term you would hear in system design interviews is Fault Tolerance, in which case a machine crashes. And Scalability, in which devices must be added to process more requests. Another term used often is request allocation. This means assigning a request to a server.
Load balancing is often tied with service discovery and global locks. The type of load we want to balance is that of sticky sessions.
Looking to ace your next interview? Try this System Design video course! 🔥
interviewready.io
00:00 Load Balancing - Consistent Hashing
00:33 Example
01:29 Server-Client Terms
02:12 Scaling
02:40 Load Balancing Problem
03:58 Hashing Requests
06:37 Request Stickiness
08:00 Splitting the Pie
10:35 Request Stickiness
13:29 Next Video!
With video lectures, architecture diagrams, capacity planning, API contracts, and evaluation tests. It's a complete package.
Code: github.com/coding-parrot/Low-...
References:
stackoverflow.com/questions/1...
www.citrix.co.in/glossary/loa...
www.nginx.com/resources/gloss...
en.wikipedia.org/wiki/Load_ba...)
www.tomkleinpeter.com/2008/03/...
michaelnielsen.org/blog/consis...
• Consistent Hashing - G...
System Design:
highscalability.com/
• What is System Design?
www.palantir.com/how-to-ace-a...
#LoadBalancer #Proxy #SystemDesign

Пікірлер: 494
@bithon5242
@bithon5242 9 ай бұрын
For anyone confused by the pie chart, the explanation he does makes sense only when you watch the whole video. In a nutshell, when you at first have 4 servers, each server handles 25% of the users. The hashing function takes users' user id or some other information that somehow encapsulates the user data (and is consistent) so any time you want to, for example, fetch a user profile you do it via the same server over and over again since user id never changes (therefore hash of a user id never changes and will always point to the same server). The server remembers that and it creates a local cache for that information for that user so that it doesn't have to execute the (expensive) action of calculating user profile data, but instead just fetches it from the local cache quickly instead. Once your userbase becomes big enough and you require more processing power you will have to add more servers. Once you add more servers to the mix, the user distribution among server will change. Like in the example from the video, he added one server (from 4 servers to 5 servers). Each server needs to now handle 20% of the users. So here is where the explanation for the pie chart comes from. Since the first server s0 handles 25% of the users, you need to take that 5% and assign it to 2nd server s1. The first server s0 no longer serves the 5% of the users it used to, so the local cache for those users becomes invalidated (i.e. useless, so we need to fetch that information again and re-cache it on a different server that is now responsible for those users). Second server s1 now handles 25%+5%=30% of the traffic, but it needs to handle 20%. We take 10% of its users and assign it to the third server s2. Again like before, the second server s1 lost 10% of its users and with it the local cache for those users' information becomes useless. Those 10% of users become third server's users, so the third server s2 handles 25%+10%=35% of the traffic. We take third server's 15% (remember, it needs to handle only 20%) and give it to the fourth server s3. Fourth server now handles 25%+15%=40% of the traffic. Like before, fourth server lost 20% of its users (if we're unlucky and careless with re-assignment of numbers it lost ALL of its previous users and got all other servers' users instead) and therefore those 20% of users' local cache becomes useless adding to the workload of other servers. Since fourth server handles 40% of the traffic, we take 20% of its users and give it to the new fifth server s4. Now all servers handle users uniformly but the way we assigned those users is inefficient. So to remedy that, we need to look at how to perform our hashing and mapping of users better when expanding the system.
@samjebaraj24
@samjebaraj24 9 ай бұрын
Nice one
@swatisinha5037
@swatisinha5037 8 ай бұрын
amazing explanation dude
@hetpatel1772
@hetpatel1772 4 ай бұрын
thanks buddy it got cleared here, now i want to ask you that how would we utilize this and make it scalable because loosing cache data will be costly.
@Pawansoni432
@Pawansoni432 4 ай бұрын
Thanks buddy ❤
@suvodippatra2704
@suvodippatra2704 3 ай бұрын
thanks dude
@Karthikdravid9
@Karthikdravid9 4 жыл бұрын
I'm a UX Designer, irrelevant for me to know this but just watching your video and sitting here willing to complete the whole series, thats how brilliant you are explaining chap.
@gkcs
@gkcs 4 жыл бұрын
Thank you!
@thinker5270
@thinker5270 2 жыл бұрын
Absolutely.
@manalitanna1685
@manalitanna1685 Жыл бұрын
I love how you've taken the time and effort to teach complex topics in a simple manner with real world examples. You also stress on words that are important and make analogies. This helps us students remember these topics for life! Thank you and really appreciate the effort!
@valiok9880
@valiok9880 5 жыл бұрын
This channel is a total gem. I don't think i've seen anything similar on youtube in regards to quality. Really appreciated it !
@gkcs
@gkcs 5 жыл бұрын
😁
@UlfAslak
@UlfAslak 3 жыл бұрын
Notes to self: * Load balancing distributes requests across servers. * You can use `hash(r_id) % n_servers` to get the server index for a request `r_id`. -> Drawback: if you add an extra server `n_servers` changes and `r_id` will end up on a different server. This is bad because often we want to map requests with the same ids consistently to the same servers (there could e.g. be cached data there that we want to reuse). * "Consistent hashing" hashes with a constant denominator `M`, e.g. `hash(r_id) % M`, and then maps the resulting integer onto a server index. Each server has a range of integers that map to their index. * The pie example demonstrates, that if an extra server is added, the hashing function stays the same, and one can then change the range-to-server-index mapping slightly so that it remains likely that an `r_id` gets mapped to the same server as before the server addition.
@senthilandavanp
@senthilandavanp 3 жыл бұрын
Thanks for this. I have a question which may easy But I am not sure about it. It is basically based on the hash value we are deciding which server do we save our data out of n number of database. What is the guarantee that hash function returns value by which request will be stored n different number of servers equally
@raghvendrakumarmishra8035
@raghvendrakumarmishra8035 2 жыл бұрын
Thanks for notes. It's good for lazy people watching video, like me :)
@adityachauhan1182
@adityachauhan1182 2 жыл бұрын
@@senthilandavanp Take few processes with different r_id and let's say there are 5 servers ...now do mod and try to find which process will load in which server...You will get your answer
@senthilandavanp
@senthilandavanp 2 жыл бұрын
@@adityachauhan1182 thank you .it answered my question.
@RohitSharma-ji2qh
@RohitSharma-ji2qh 2 жыл бұрын
thanks for the summary
@proosdisanayaka1900
@proosdisanayaka1900 4 жыл бұрын
First of all, this is a perfect lesson and I have absorbed 100% of it as a school student. the pie chart was little confusion at first cus with 4 servers it's like 25 Buckets and then you added 1 server it's pretty much 20 - 5 buckets. so divide pie to 5 and mark each one 20 buckets is the easiest way
@sadiqraza1658
@sadiqraza1658 3 жыл бұрын
Your way of explanation with real-life examples is really effective. I can visualize everything and remember it easily. Thanks for this.
@ruchiragarwal4741
@ruchiragarwal4741 Жыл бұрын
That's an eye-opener. Have been working in industry for a few years now but never realised how small changes like this can affect the system. Thank you so much for the content!
@nxpy6684
@nxpy6684 Жыл бұрын
If anyone is confused by the pie diagram, We need to reduce the distribution from 25 each to 20 each. So we take 5 from the first server and merge it with the second one. Then we take 10(5 from the first one and 5 from the second one) and merge it with third. So now, both one and two have 20 each. Then we go on taking 15 from third and merging it with fourth and finally, taking 20 from four to create the fifth server's space. Please correct me if I'm wrong. This is just a simple breakdown which I think is what he intended
@sairamallakattu8710
@sairamallakattu8710 Жыл бұрын
Thanks for explanation... Same here..
@wendyisworking2297
@wendyisworking2297 Жыл бұрын
Thank you for your explanation. It is very helpful.
@arymansrivastava6313
@arymansrivastava6313 Жыл бұрын
Can you please tell what is this pie chart signifying, as to what are these 25 buckets, is it storage space or number of requests handled? It will be very helpful if you could help with this question.
@vanchark
@vanchark 10 ай бұрын
@@arymansrivastava6313 I think the numbers represent # of users. Let's say each user has one request. Before, we can say users 1-25 were mapped to server 0, 26-50 mapped to server 1, 51-75 mapped to server 2, and 76 - 100 mapped to server 3. By adding another server (server 4), we have to redistributed/remap these users across 5 servers now instead of 4. The redistribution process she showed in the video made it so that each user is now assigned to a new server. This is problematic because server 1 used to cache the information of users 1-25, but now that entire cache is useless. Instead, it's better to minimize the changes we make to each server. That's how I understood it, please correct me if I'm wrong
@lordofcocks7244
@lordofcocks7244 9 ай бұрын
Further explanation: 1. Suppose you're serving users 1 to 20 on S0, 21-40 on S2 and so on. If you insert or remove a server, each server will have to adjust in a way so that load is balanced. 2. Now, suppose S1 is dropping 5 users, and these requests are now being routed to server Sn. 3. Each server has some local data, cache, etc. for the users/requests it's been serving, and migrating all these is costly. The "buckets" here are basically the operations involved during these kind of migrations.
@vanshpathak7565
@vanshpathak7565 5 жыл бұрын
You give great explanations !! And little video editing efforts make the video so interesting. Going to watch all videos uploaded by you.
@sumitdey827
@sumitdey827 4 жыл бұрын
seems like a 4th-year senior teaching the juniors...your videos are Beast :)
@KarthikaRaghavan
@KarthikaRaghavan 5 жыл бұрын
Hey man, cool explanation for all the advanced system design learners... nice! keep it coming!!
@gkcs
@gkcs 5 жыл бұрын
Thanks!
@Varun-ms5iv
@Varun-ms5iv 2 жыл бұрын
I subscribed/bookmarked your channel I don't know when I knew that I'll need it at some point in time and that time is now. Thank you for the series...❤️❤️
@aryanrahman3212
@aryanrahman3212 Жыл бұрын
This was really insightful, I thought load balancing was simple but the bit about not losing your cached data was something I didn't know before.
@ryancorcoran3334
@ryancorcoran3334 3 жыл бұрын
Man, thanks! You made this easy to 100% understand. Your teaching style is excellent!
@Codearchery
@Codearchery 6 жыл бұрын
Notification Squad :-) The problem with having awesome teachers like Gaurav Sir, is that you want the same ones to teach you in college too :-) Thanks Gaurav sir for System Design series.
@gkcs
@gkcs 6 жыл бұрын
Thanks CodeArchery!
@hiteshhota6519
@hiteshhota6519 5 жыл бұрын
relatable
@yedneshwarpinge8049
@yedneshwarpinge8049 Жыл бұрын
@@gkcs sir could you please explain that hoe does the server goes upto 40 buckets .......I did not understand at (8:46)
@sekhardutt2457
@sekhardutt2457 4 жыл бұрын
you made it really simple and easy to understand. I don't bother searching any other video on system design, I can simply look into your channel. Thank you very much, appreciate your efforts .
@gkcs
@gkcs 4 жыл бұрын
Thank you!
@sagivalia5041
@sagivalia5041 Жыл бұрын
You seem very passionate about the subject. It makes it 10x better to learn that way. Thank you.
@gkcs
@gkcs Жыл бұрын
Thank you!
@adheethathrey3959
@adheethathrey3959 3 жыл бұрын
Quite a smart way of explaining the concept. Keep up the good work. Subscribed!
@deepanjansengupta7944
@deepanjansengupta7944 3 жыл бұрын
amazing video with extremely lucid explanations. wishing you the best, keep growing your channel. from a Civil Engineer just randomly crazy about Comp Science.
@mukundsridhar4250
@mukundsridhar4250 5 жыл бұрын
This method is ok when accessing a cache and the problems that arise are somewhat mitigated by consistent hashing. However there are two thing i want to point out 1. Caching is typically done using a distributed cache like memcached or redis and the instances should not cache too muchinformation. 2. If you want to divert requests from a particular request id then you should configure your load balancer to use sticky sesssions . The mapping between the request id and the ec2 instance can be stored in a git repo or cookies can be used etc.
@gkcs
@gkcs 5 жыл бұрын
Yes, distributed caches are more sensible to cache larger amounts of data. I read your comment on the other video and found that useful too. Thanks for sharing your thoughts 😁
@ShubhamShamanyu
@ShubhamShamanyu 3 жыл бұрын
Hey Gaurav, You have a knack for explaining things in a very simple manner (ELI5). There is one part of this discussion which I feel conveys some incorrect information (or I might have understood it incorrectly). You mention that 100% of requests will be impacted on addition of a new server. However, I believe that only 50% of the requests should be impacted (server 1 retains 20% of its original requests, server 2 15%, server 3 10%, and server 4 5%). In fact, it's always exactly 50% of the requests that are impacted on addition of 1 new server irrespective of the number of original servers. This turned out to be a pretty fun math problem to solve (boils down to a simple arithmetic progression problem at the end). The reason your calculation results in a value of 100% is because of double calculation: Each request is accounted for twice, once when it is removed from the original server, and then again when it is added to the new server.
@akashpriyadarshi
@akashpriyadarshi Жыл бұрын
I really like how you explained why we need consistent hashing.
@umangkumar2005
@umangkumar2005 2 ай бұрын
you are amazing teacher, teaching such a complicated topic in such a efficient manner,I didn,t get even a first job , and i am able to understand
@ayodeletim
@ayodeletim 4 жыл бұрын
Just stumbled on your channel, and in few minutes, i have learned a lot
@mostinho7
@mostinho7 Жыл бұрын
Done thanks Traditional hashing will make requests go to different servers if new servers are added, and ideally we want requests from the same user to hit the same server to make use of local caching
@arvindgupta8991
@arvindgupta8991 5 жыл бұрын
Thanks bro for sharing your knowledge.Your style of explaining is Great.
@AbdulBasitsoul
@AbdulBasitsoul 4 жыл бұрын
Hi Gaurav, you explained the concepts properly. keep it up. Also focus on the tools you use. use a better and darker maker. manage light reflection from the board. in this video these 2 were bit annoying. Your way of teaching is good and to the point. Good luck.
@tejaskhanna5155
@tejaskhanna5155 3 жыл бұрын
This is like the closest thing to an ELI5 on KZfaq !! Greta stuff man 😀🙌
@maxwelltaylor3544
@maxwelltaylor3544 6 жыл бұрын
Thanks for the concept lesson !
@thomaswiseau2421
@thomaswiseau2421 5 жыл бұрын
Thank you Gaurav, very cool! Seriously though, thanks, your videos are really helping me through college. Very epic.
@adeepak7
@adeepak7 6 жыл бұрын
Thanks for sharing. The concept of changing the cache on every server is cool.
@yourstrulysaidi1993
@yourstrulysaidi1993 2 жыл бұрын
Gaurav, your explanation is awesome . i addicted to your way of teaching . God bless you with more power :-)
@paridhijain7062
@paridhijain7062 2 жыл бұрын
Nice Explanation. Was finding a perfect playlist on YT to teach me SD. Now, its solved. Thank you for such a valuable content.
@gkcs
@gkcs 2 жыл бұрын
Awesome! You can also watch these videos ad-free (and better structured) at get.interviewready.io/learn/system-design-course/basics/an_introduction_to_distributed_systems.
@nomib_k2
@nomib_k2 Жыл бұрын
indian accent is one of accent that can make my learning process easier. It sounds clear on my ears rather native english spoken by most western tutors. Great job man
@SusilVignesh
@SusilVignesh 6 жыл бұрын
This is informative and thanks once again :-)
@mayureshsatao
@mayureshsatao 6 жыл бұрын
Thanks Gaurav for this interesting series Keep it up... : )
@sivaramakrishnanj300
@sivaramakrishnanj300 5 жыл бұрын
Helped me a lot! Thank u👏
@vinayakchuni1
@vinayakchuni1 5 жыл бұрын
Hey Gaurav , in the first part of the video you mention and by taking the mod operation you distribute the requests uniformly . What kind of assumptions do you make ( and why) on the hash function which insures that the requests are uniformly distributed . I could come up with a hash function which would send all the requests to say server 1
@ShahidNihal
@ShahidNihal 10 ай бұрын
10:26 - my expression to this video. Amazing content!
@knightganesh
@knightganesh 5 жыл бұрын
Superb bro .. thanks a lot for your efforts to make videos...
@Grv28097
@Grv28097 6 жыл бұрын
Really amazing lecture. Waiting for your B+ Trees video as promised :P
@gkcs
@gkcs 6 жыл бұрын
Haha, thanks!
@jagadeeshsubramanian239
@jagadeeshsubramanian239 4 жыл бұрын
Simple & clean explanation
@kabiruyahaya7882
@kabiruyahaya7882 5 жыл бұрын
You got a new subscriber. You are very very great
@apratim1919
@apratim1919 5 жыл бұрын
Nice video. I feel that you are meant to be a teacher :) ! You have the flair for it. Not everyone with knowledge can teach it. Do consider when you get time in life ;) ! Cheers, all the best!
@_romeopeter
@_romeopeter 2 жыл бұрын
Thank you for putting this out!
@abhishekpawar921
@abhishekpawar921 3 жыл бұрын
I'm late here but the videos are amazing. I'm going to watch the whole playlist
@farflunghopes
@farflunghopes 5 жыл бұрын
Love this!
@mikeendsley8453
@mikeendsley8453 4 жыл бұрын
Damn man, you are really good at instruction... sub’d!
@voleti19
@voleti19 5 жыл бұрын
Very well explained!!
@vulturebeast
@vulturebeast 3 жыл бұрын
On the entire KZfaq this is best❤️
@alitajvidi5610
@alitajvidi5610 3 жыл бұрын
You are a great teacher!
@samitabej9279
@samitabej9279 2 жыл бұрын
Hi Gaurav, the concept of load balance design is very good and understandable. Thanks for your effort. I have small doubt that if same number of old servers removed and added new servers to the distributed system, will this load balance have effect? or will this consistent hashing mechanism be same with no cost effective?
@manishasinha6694
@manishasinha6694 5 жыл бұрын
Gaurav your videos are amazing ! Its being a great help . Thank you so much :-)
@gkcs
@gkcs 5 жыл бұрын
Thanks!
@SK-ju8si
@SK-ju8si 3 ай бұрын
Brilliant. thank you!
@amonaurel3954
@amonaurel3954 3 жыл бұрын
Great videos, thank you!
@saransh9306
@saransh9306 5 жыл бұрын
amazing info..thank you for sharing
@dhruvseth
@dhruvseth 4 жыл бұрын
Hi Gaurav great video, can you quickly elaborate on the Pie Chart you made and did the 5+5+10... maths you kinda lost me there and I am trying to figure out intuitively what you tried to show using the Pie Chart example when a new server is added. Thank you!
@gkcs
@gkcs 4 жыл бұрын
The pie represents the load on each server, based on the range of requests it shall handle. The requests have random ids between 0 and M. I draw the pie chart with each point in the circle representing a request ID. Now a range of numbers can be represented by a slice in the pie. Since the request IDs are randomly and uniformly distributed, I assume that the load on each server is proportional to the thickness of pie slice it handles. IMPORTANT: I assume the servers cache data relevant to their request ID range, to speed up request processing. For example, take the profile service. It caches profiles. It's pie chart will be all profiles from 0 to M. The load balancer will assign loads to different nodes of this service. Suppose one node in this service handles the range 10 to 20. That means it will cache profiles from 10 to 20. Hence the cached profiles are (20 - 10) = 10. The pie calculations in the video show the number of profiles a node has to load or evict, when the number of nodes changes. The more a node has to load and evict, the more work it needs to do. If you put too much pressure on one node (as shown here with the last node), it has a tendency to crash. The consistent hashing video talks about how we can mitigate this problem :)
@dhruvseth
@dhruvseth 4 жыл бұрын
@@gkcs Thank you so much for a fast and well detailed response! I understand perfectly now. Very much appreciative of your hard work and dedication when it comes to making videos and reaching out to your audience. Keep up the great work and stay safe! Sending love from Bay Area! 💯
@jameysiddiqui6910
@jameysiddiqui6910 3 жыл бұрын
thanks for asking this question, I was also lost in the calculation.
@Purnviram03
@Purnviram03 3 жыл бұрын
​@@gkcs This comment really helped, was a bit confused about the pie chart explanation at first. Thanks.
@sonnix31
@sonnix31 3 жыл бұрын
@@gkcs Still not very clear. DOnt know how you jump to 40 :(
@brunomartel4639
@brunomartel4639 4 жыл бұрын
awesome! consider blocking the background light with something to reduce light reflection!
@mahendrachouhan7788
@mahendrachouhan7788 5 жыл бұрын
nice explanation of the concepts
@dilawarmulla6293
@dilawarmulla6293 6 жыл бұрын
Awesome gk. I would suggest you to more focus on system design videos as it's resources are less
@akshayakumart5117
@akshayakumart5117 5 жыл бұрын
You got a subscriber!!!
@ruslanustiuhov5510
@ruslanustiuhov5510 4 жыл бұрын
+1
@adiveppaangadi7107
@adiveppaangadi7107 4 жыл бұрын
Awesome explanation... Waiting for middle ware admin related issues... Was tomcat weblogic
@NeverMyRealName
@NeverMyRealName 3 жыл бұрын
awesome video brother. keep it up!
@nareshkaktwan4918
@nareshkaktwan4918 5 жыл бұрын
@Gaurav Sen: I want to summarize what I understood from PI chart part, just rectify me if I understood it wrong. Directly adding another server will definitely reduce the load on each server but if not implemented properly then it could impact on the cache part. If major of the request got re-directed to different servers than our cache part will be of not that help to us. Taking small % of req load will not impact the cache part much.
@gkcs
@gkcs 5 жыл бұрын
Exactly!
@tacowilco7515
@tacowilco7515 4 жыл бұрын
The only tutorial with an Indian accent which I enjoy watching :) Thanks dude! :)
@Arunkumar-eb5ce
@Arunkumar-eb5ce 6 жыл бұрын
Gaurav, I just love the way you deliver the lectures. I have a query, You spoke about spending people to specific servers and have their relevant information will be stored in the cache. But won't it be a good idea if we have an independent cache server running master-slave?
@gkcs
@gkcs 6 жыл бұрын
That's a good idea too. Infact, for large systems, it's inevitable.
@tsaed.9170
@tsaed.9170 3 жыл бұрын
That moment at 10:25.... 😂😂 I actually felt the server engineer cry for help
@AshokYadav-np5tn
@AshokYadav-np5tn 5 жыл бұрын
I wished i could have watched this video earlier so i could answer in an interview. Thanks gourav for teaching. It is quite similar to how hashmap work.. isn't it?
@lovemehta1232
@lovemehta1232 Жыл бұрын
Dear Mr Gaurav, I am a civil engineer and currently working on one project where we are trying to add some technology in construction activity, I was struggling to understand what is system design, which is the best combination of front end and back end language, which system design should I adopt and many more things like this as I am not from IT field but I must say you made me understood so many technical thing in very layman language. Thank you so much for that
@gkcs
@gkcs Жыл бұрын
Thanks Love! Check out the first video in this channel's system design playlist for a good definition of system design 😁 I would suggest using python and JavaScript (React or Vue.js) as backend and frontend tech respectively, to start with your software development journey.
@pallav29
@pallav29 2 жыл бұрын
Hi Gaurav. Thanks for the informative video . Quick question. How did u got the values h(10) , h(20) and h(35) ? are these the random numbers generated from the server for each request ? Also did how did each of these request generated the hash value of 3, 15 and 12 respectively?
@DarshanSenTheComposer
@DarshanSenTheComposer 4 жыл бұрын
Hello @Gaurav Sen. Started watching this awesome series because I wanted to get some good knowledge about building large scale applications. You teach extremely well (as usual). However, I can't really wrap my head around what the pie chart at 8:16 exactly means and how it changes when we add the fifth server. It would be really awesome if you could kindly explain that here or share a link that discusses it instead. Thanks a lot! :) Edit: I finally understood it! Yusss! The issue was in the positioning of the numbers in the pie chart. I think, the initial numbering was supposed to be 0, 25, 50 and 100 instead of all 25's. Thanks again. :)
@singhanuj620
@singhanuj620 2 жыл бұрын
How come he added 5+5+10 .... etc on addition of 5th server. Can you help me understand ?
@Sandeep-gv2qk
@Sandeep-gv2qk 4 жыл бұрын
For the 2nd optimal pie chart drawn, the change is 40 right? 5 lost by each existing server, and 20 gained by new server.
@johnz1611
@johnz1611 4 жыл бұрын
X/N, where 1/N is the load factor. What exactly does this load factor represent ?
@sonalpriya1742
@sonalpriya1742 4 жыл бұрын
i couldnot understand the pie chart thing well, what should i read to understand this?
@vijayjagannathan5164
@vijayjagannathan5164 5 жыл бұрын
Hey @Gaurav! Amazing set of videos on system design for newbies like me. I would just like to know if there is any suggested order in which we've to grasp material? Like after the 8th video in this playlist, we have whatsapp system design and then what is an API, NoSQL databases and so on. So, if at all any order exists which allows to learn/grasp concepts in a better way, what order/approach would you suggest ? Thanks :)
@akashtiwari7270
@akashtiwari7270 5 жыл бұрын
Hi Gaurav, Awesome video . Can you please do a video on Distributed Transaction Managment
@gkcs
@gkcs 5 жыл бұрын
Thanks! I'll be working on this, yes 😁
@TheSumanb
@TheSumanb 4 жыл бұрын
Awesome, I subscribed ...thanks
@Debalina
@Debalina 4 жыл бұрын
i did not understand the pie chart, breakdown of request. How the request numbers breakdown like that.
@valentinfontanger4962
@valentinfontanger4962 4 жыл бұрын
Thank you sensei !
@nishantdehariya5769
@nishantdehariya5769 4 жыл бұрын
Awesome explanation
@algoseekee
@algoseekee 4 жыл бұрын
Hey, thanks for this video. I have a question. If request IDs are randomly generated (with equal probability) why don't we just have them in a range 0..n which maps directly to servers?
@algoseekee
@algoseekee 4 жыл бұрын
Answer: there is an infinite number of requests and only n servers, that's why we need modulo here.
@ambrishawasthi5809
@ambrishawasthi5809 6 жыл бұрын
Thanks. what if we associate user id to server but at a time say 80% of that server are offline then our server is underutilized
@gkcs
@gkcs 6 жыл бұрын
No, the server does not block any place for the user. The user id is used to map to the server, and a new user has as much chance of hitting that given server as any other. :)
@razaarashid
@razaarashid 4 жыл бұрын
How adding server to the normal hashing technique is a big change? Are we storing these mapping somewhere of yes then what's the need to that?
@anon_1858
@anon_1858 4 жыл бұрын
Very well explained Sir. Can you please suggest any books for the same?
@dishanamdev2620
@dishanamdev2620 5 ай бұрын
i didn't get the pie chart thing. What he mean by this has to take this 5 bucket at 8:40? and bucket means numbers so here that number is the number of requests that comes to the server? Can somebody please explain me ?
@anirudhagarwal5950
@anirudhagarwal5950 5 жыл бұрын
Hey, I had a doubt when u say that hash function is universally random, then how can one be sure that it would balance load equally?
@gkcs
@gkcs 5 жыл бұрын
Uniform and random. Expected to balance load equally then.
@letslearnwi
@letslearnwi 3 жыл бұрын
Very well explained
@HELLDOZER
@HELLDOZER 5 жыл бұрын
Dude... great vids, you can't expect uniformity out of randomness [ it wouldn't random anymore if it was uniform).... apache, ngnix etc all look at the number of requests that each machine is processing and send figures out the one with the lowest and sends it to that
@gkcs
@gkcs 5 жыл бұрын
Thanks Harish! crypto.stackexchange.com/questions/33387/distribution-of-hash-values
@yizhihu8477
@yizhihu8477 3 жыл бұрын
Great content! Why wouldn't the first approach work for a newly added server? Are we worried more about the cache miss? I believe if the cache has a timeout, and the frequency of adding a new server is not often. The system will be in a good performance after the old cache timeout.
@nezukovlogs1122
@nezukovlogs1122 Жыл бұрын
one more problem other than cache miss, Lets say request r1 always will be going to server s1 and req r1 has session info stored on s1. So, if number of server changes, chances of request r1 will be going to other server and not server s1 where it has its session info. SO, user will lost the session info.
@yedneshwarpinge8049
@yedneshwarpinge8049 Жыл бұрын
@Gaurav Sen sir could you please explain that how does the server goes up to 40 buckets .......I did not understand at (8:46)
@lyhov.2572
@lyhov.2572 5 жыл бұрын
Nice topic, thank you
@gkcs
@gkcs 5 жыл бұрын
:D
@user-oy4kf5wr8l
@user-oy4kf5wr8l 5 жыл бұрын
Amazing!
@kausachan4167
@kausachan4167 2 жыл бұрын
Can anyone help me explaining the first pie chart?
@sundayokoi2615
@sundayokoi2615 6 ай бұрын
This is what I understand about the pie chart explanation. The objective is to reduce the measure of randomness in the distribution of request among the servers because of the caching done on each server and the fact that user request are mapped to specific servers. So you have 100% request been served to 4 servers which means the load is distributed by 25% to each server. When you scaled up and add a new server, you reduce the load on each server by 5% to make up the extra 20% needed by the new server, that way reducing the random user distribution to each server and ensuring that user data stored in the caches is relatively consistent. Correct me if I'm wrong about this, thank you.
@m13m
@m13m 6 жыл бұрын
More system design Videos
@user-hx3tl6hb9g
@user-hx3tl6hb9g 4 жыл бұрын
I don't understand the pie, why there is a 5 change off when a request come? can anyone explain it for me?
@muhammadtella7676
@muhammadtella7676 5 жыл бұрын
You are certainly an awesome teacher. It was crystal clear. Thanks.
@gkcs
@gkcs 5 жыл бұрын
Thanks!
@rohithegde9239
@rohithegde9239 6 жыл бұрын
Hey one suggestion before making new videos: you could list in the description what are the prerequisites before watching this video. Like in this video I didn't know about hashing. So I had to know about that first. So if you could list down the prerequisites we could go and get to know those terms before hand for understanding the video better.
@gkcs
@gkcs 6 жыл бұрын
Ahh, that's a veey good suggestion. I'll take it, thanks!
What is CONSISTENT HASHING and Where is it used?
10:50
Gaurav Sen
Рет қаралды 773 М.
System Design: TINDER as a microservice architecture
36:41
Gaurav Sen
Рет қаралды 1,2 МЛН
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 39 МЛН
Why Is He Unhappy…?
00:26
Alan Chikin Chow
Рет қаралды 36 МЛН
20 System Design Concepts Explained in 10 Minutes
11:41
NeetCode
Рет қаралды 934 М.
WHATSAPP System Design: Chat Messaging Systems for Interviews
25:15
Gaurav Sen
Рет қаралды 1,8 МЛН
Load balancing in Layer 4 vs Layer 7 with HAPROXY Examples
37:33
Hussein Nasser
Рет қаралды 159 М.
What is a Load Balancer?
8:22
IBM Technology
Рет қаралды 227 М.
What is a MESSAGE QUEUE and Where is it used?
9:59
Gaurav Sen
Рет қаралды 957 М.
Google system design interview: Design Spotify (with ex-Google EM)
42:13
IGotAnOffer: Engineering
Рет қаралды 1 МЛН
Data Consistency and Tradeoffs in Distributed Systems
25:42
Gaurav Sen
Рет қаралды 182 М.
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 39 МЛН