System Design: What is Load Balancing?

Поделиться
HTML-код
  • Опубликовано: 22 дек 2024

Комментарии • 59

  • @ahsanrfq5968
    @ahsanrfq5968 4 года назад +28

    I think "Security" deserves to be on the list too, since only the load balancer is exposed to the public net.

  • @sup3rd
    @sup3rd 4 года назад +4

    Just found your channel and I'm really enjoying these bite sized videos for certain topics. It certainly helps a new developer get in touched with industry key terms and concepts.

    • @BeABetterDev
      @BeABetterDev  4 года назад

      Welcome aboard!

    • @walidhabari3600
      @walidhabari3600 3 года назад

      @@BeABetterDev If i have a web application installed on 1 server, what is the method to make the app more scalable.
      and the load balancer router used only if we have 1 server running the application ?

  • @ViTran6
    @ViTran6 2 года назад +1

    Wow thank you, you're super great at explaining technical concepts.

  • @nixcutus
    @nixcutus 3 года назад +1

    Precisely what i needed to understand this...

  • @palvinderbhatia3941
    @palvinderbhatia3941 3 года назад +7

    Great Explanation :D
    Question : Doesn't LB again makes a Single point failure problem??

  • @azimakhtarshenas2501
    @azimakhtarshenas2501 2 года назад +1

    This is amazing and helped me fully understand what I was puzzled in.

  • @polishedbychar9232
    @polishedbychar9232 3 года назад +2

    Great explanation! Thank you.

  • @magdcs
    @magdcs 3 года назад +2

    Fantastic explanation.

  • @urunovtimes5816
    @urunovtimes5816 4 года назад +2

    wow really great, detail explained and more improvement

  • @PaulEllisBIGDATA
    @PaulEllisBIGDATA 3 года назад +1

    DUDE. Great video. Thank you.

  • @NeilKilroy
    @NeilKilroy 3 года назад +1

    You explain things very well

  • @slimxdaturk
    @slimxdaturk 3 года назад +1

    Great explanation. I'll be setting up a GEO based load balancer :)

    • @BeABetterDev
      @BeABetterDev  3 года назад

      Thanks Slim! Good luck on your project :)

  • @elenaperez6327
    @elenaperez6327 3 года назад +1

    Fantastic video! Thanks a lot.

    • @BeABetterDev
      @BeABetterDev  3 года назад +1

      You're very welcome Elena!

    • @elenaperez6327
      @elenaperez6327 3 года назад

      @@BeABetterDev I have a question please. I have a system design interview coming up so how do I know which load balancer to recommend? I know nginx is popular. I know a bit about aws but I also know the company uses GCP so is it best to go with that? Thanks for your help :)

    • @BeABetterDev
      @BeABetterDev  3 года назад +1

      Hi Elena, I haven't worked with NGINX too much but here's my take.
      NGINX load balancing requires server setup, configuration, updates, and monitoring that needs to be done to ensure the LB is constantly up to date and working correctly. Additionally there's lots of manual configuration that needs to be done via config files that affect how load is distributed across the machines in the cluster. This may be overwhelming for some to understand the implications of the settings and how to optimize for their use case.
      AWS / GCP both have Load Balancer products that generally take care of the installation/updates for you. You don't have to worry about provisioning the server as this is all done for you and AWS ensures a healthy load balancing instance(s) remains up at all times. The nice thing is that configuration is pretty self explanatory and can be set up through the AWS / GCP console.
      One thing I really like about AWS is that it supports two popular types of load balancers, Application and Network. Application load balancer operates on the L7 level of the OSI model - this allows you to route requests to different targets based on the content within HTTP request. AWS also supports a network load balancer which operates on the L4 level which is generally operating on the packet level. L4 is much more efficient than L7 and allows you to pump many many more requests through it without compromising it - so its great for scale. There's a great article on the difference between L4 and L7 here: www.nginx.com/resources/glossary/layer-4-load-balancing/
      All in all, what LB product you go with generally depends on questions you want to ask yourself like "how much configuration do I want to do? what scale are we expecting? do we want to route requests based on request content or not?" The answers to these questions should determine the path you take.
      Hope this answer was helpful. I'll keep an eye on this comment stream if you have any followup questions. Alternatively you can email me at daniel@beabetterdev.com and I'll do my best to get back to you.
      Good luck on your interview!

    • @elenaperez6327
      @elenaperez6327 3 года назад +1

      @@BeABetterDev Thank you so so so so much Daniel for this detailed answer, you are awesome! I found it very helpful indeed and made me realise which LB I want to go with. I am super happy I found your channel and will definitely recommend to others.

    • @BeABetterDev
      @BeABetterDev  3 года назад +1

      Thanks so much Elena! Glad I could help and welcome to the channel! Thanks so much for sharing with others - really appreciate you getting the word out!
      Daniel

  • @shirish2005
    @shirish2005 2 года назад

    please provide more detailed video with various type of load balancer

  • @andriys5772
    @andriys5772 4 года назад +1

    Thank you!

  • @mrchad97z49
    @mrchad97z49 2 года назад

    how does the load balancer Offload traffic or redirect traffic OFF itself? meaning.. if a request comes into the load balancer, then how does it keep all that traffic from flowing through the load balancer itself? It has to route traffic away from itself. So, how does that work if the load balancer is the main point of entry to the network?

  • @jennwng
    @jennwng 3 года назад

    Love the video! Thanks for the great content :)

  • @beto.aveiga
    @beto.aveiga 3 года назад +1

    When people talk about load balancing, my doubt is always, "What will you do with the state"? How can I "scale" by adding different machines if I need one source of truth for my state? On applications with databases, we can easily replicate many things to serve more traffic. Still, in the end, we will have one super central machine with the DB or multiple DBs, which makes me think of a big issue due to replication. Thanks for the video!

    • @MaxMaxx-tb6nz
      @MaxMaxx-tb6nz Год назад

      Use database for states. Use specialized servers to handle db and don't do it on your own

  • @AlDumbrava
    @AlDumbrava 4 года назад +1

    Ok new question: So load balancing and horizontal scaling have allowed you to handle increasing traffic. But! If all these requests then hit a separate database server, you still have overload issues no? And if you were to split it up (not sure how (I'm a newbie)), would you not have data integrity issues??

    • @BeABetterDev
      @BeABetterDev  4 года назад +3

      Hey Alexandru,
      Great question! You will definitely get increased traffic on your database. To mitigate this, you can use a cloud based database provider that handles autoscaling as well (DynamoDB is a good choice!).
      Cheers

  • @idrisapatira172
    @idrisapatira172 3 года назад +1

    Nice....so on point

  • @churka6398
    @churka6398 3 года назад +3

    Dumb question, but, what if load balancer is overloaded? What makes one load balancer better in terms of handling millions of users compared to two web servers? Are these machines normally resource-intensive?

    • @BeABetterDev
      @BeABetterDev  3 года назад +3

      Hi Churka,
      Load balancers are usually dedicated pieces of hardware that are optimized to simply handle large volumes of traffic concurrently. I've seen many load balancers capable of handling thousands of requests concurrently and routing them successfully to appropriate clients.
      As an application grows, it may be appropriate to 'partition' the load balancers. Its almost like a piece of lego that can be continuously broken apart into separate chunks. Each chunk has the identical amount of scaling capability of the parent.
      Hope this helps!

  • @15lastone
    @15lastone 3 года назад +3

    Thanks for the tutorial clearly it helps massively, can we configure 2 load balancers instead of one(so called Active-Passive) in case of one becomes unresponsive?
    Note: I'll go and hit the subscribe button

    • @BeABetterDev
      @BeABetterDev  3 года назад +3

      Hi Tcherno! This is definitely possible to set up an active-passive configuration. Of course this depends on the tech stack youre using. If youre using something like AWS load balancers, this is handled automatically for you. But if you're rolling your own for instance, nginx application, it would require more work on your part.
      Hope this helps and thanks for watching!

  • @Aalii6
    @Aalii6 2 года назад

    interesting topic, thank you!

  • @amir.maimon
    @amir.maimon 3 года назад

    What is the different between a load balancer and a router? Both are used to handle traffic.

  • @MadhusudanBhosale
    @MadhusudanBhosale 4 года назад +1

    Great information!
    Thank you..

  • @subhasishhalder4817
    @subhasishhalder4817 2 года назад

    Isin't consistent hashing one of the ways to route the traffic?

  • @malleshk2091
    @malleshk2091 3 года назад

    Nice explanation. I have a small question. Is it not that load balancer itself will become bottle neck as all requests will come to it and it has to forward requests? How is this handled?
    Is return traffic handled from server to client through load balancer or it goes directly between server and client? If it goes through load balancer is it not a bottle neck?

    • @BeABetterDev
      @BeABetterDev  3 года назад

      Hi Mallesh,
      This is a great question. The load balancers are typically highly specialized hardware that can handle many many concurrent requests/connections at the same time. Additionally, they have built in health checks to ensure both the LB and downstream targets are always available. In the event of a failure, most cloud providers will automatically provision a new LB for you with no action from your side.
      Hope this helps,
      Daniel

  • @pareshdehadray7414
    @pareshdehadray7414 3 года назад +1

    Thanks for such informative video. Can one load balancer handle millions of requests? How Facebook, Amazon etc handles the user traffic? Do they have single load balancer? If I am in India and Load balancer is in USA so does it mean my request will go USA Load balancer and then to actual server for processing? Kindly explain.

    • @BeABetterDev
      @BeABetterDev  3 года назад +1

      Hi Paresh,
      Load balancers can definitely handle millions of requests. This is what they were designed to do. Websites like Facebook, Amazon, etc do have load balancers on the backend, but make heavy use of caching to reduce the load on their backend services unless it is absolutely necessary. Hope this makes sense.
      Daniel

  • @muhammadzulhilmi6025
    @muhammadzulhilmi6025 3 года назад

    Liked! Subscribed! Hey got question here, how do we point public IP and private for load balancers? I understood private in vm itself and public definitely via firewall, but how about for LoadBalance + IPSec config? Not sure if you understand what I meant.

  • @heyaParanoiA
    @heyaParanoiA 3 года назад

    : hi.. i have a question
    can you apply load balancing in a scenario when 1 machine/ISP connection has the highest priority while the others would be just backups? (using this setup for home-based ISP connection btw)
    great video!

    • @BeABetterDev
      @BeABetterDev  3 года назад

      Hi there! Yes this is certainly possible, but I believe this would need to occur at the DNS level. What you are effectively asking for is a concept called DNS Failover. You can learn more about it here: docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring.html

  • @egor.okhterov
    @egor.okhterov Год назад

    Who balances Load Balancer and DNS server?

  • @chillsthrillstv
    @chillsthrillstv Год назад +1

    "Wow my writing is terrible, I apologise" 😅😂

  • @joanikirbyhomes
    @joanikirbyhomes 3 года назад +1

    Way to dumb it down so amateurs can understand the concept!