Load Balancer tutorial | Code Decode | Types of Load Balancers | System Design Interview Questions

Поділитися
Вставка
  • Опубліковано 12 жов 2024
  • In this video of code decode we have explained about load balancer
    Udemy Course of Code Decode on Microservice k8s AWS CICD link:
    openinapp.co/u...
    Course Description Video :
    yt.openinapp.c...
    Next level App link : next-level.one...
    What are load balancers
    When we scale our applications, we have multiple instances of servers deployed.
    Now To evenly distribute the incoming requests among the healthy server is a big task.
    That task is done by Load balancers
    The load balancer's responsibility is to equally distribute each client's requests among the pool of available servers. In order to prevent overtaxing or crashing servers, load balancers carry out this function.
    Load balancing layer is the first point of contact within a data centre. If a service processes a few hundred or even a few thousand requests per second, a load balancer might not be necessary. Nevertheless, load balancers offer the following characteristics for handling an increase in client requests:
    Scalability: The application's or service's capacity can be effortlessly extended by additional servers. So scaling up or scaling down is transparent to end users thanks to load balancers.
    Availability: The system continues to function even if some servers have problems or go offline. Hiding server errors and failures is one of the tasks performed by load balancers.
    Performance: Requests can be forwarded by load balancers to servers that are under less demand, giving users faster response times. This enhances resource usage while simultaneously enhancing performance.
    Application of load balancers
    Generally, LBs sit between clients and servers. Requests go through to servers and back to clients via the load balancing layer. However, that isn’t the only point where load balancers are used.
    Consider a Microservice Architecture
    There will client - API gateway - MS1 - MS2
    You can keep load balancer between client and API Gteway instance (multiple)
    Then between Gateway and MS1(multiple Instances)
    MS1 and MS2 (multiple)
    MS2 and MS1’s DB connections with DB servers ()
    Don’t you think Load balancer is a SPOF?
    As a disaster recovery measure, load balancers are typically deployed in pairs.
    The entire service will cease to function if one load balancer fails
    Enterprises typically deploy clusters of load balancers that constantly monitor each other's health using heartbeat communication in order to maintain high availability.
    The backup LB can take over in the event of the primary LB failing. But, manual rerouting can also be done in an emergency if the cluster as a whole fails.
    Types Of load Balancers
    Types of Load balancers:
    Global Server Load Balancer
    Local load balancer
    When we need to load balancer the request within Same Data center - Use local Load balancer.
    While Global is used to distribute the Load request to server outside that Datacenter too.
    These Global LB are used if there is a Large network failure, Power Failure
    So if you have Your application - Geographically distributed then use This else Local LB will work lIke a charm.
    How Load Balancer Distributes Requests?
    Round-robin scheduling: With this approach, each request is sequentially forwarded to a different server in the pool.
    Weighted round-robin: It is preferable to employ a weighted round-robin algorithm when some servers are better equipped to handle client requests. Each node in a weighted round-robin algorithm is given a weight. Requests from clients are forwarded by LBs based on the node's weight. The number of tasks increases as the weight does.
    Most Asked Core Java Interview Questions and Answers: • Core Java frequently a...
    Advance Java Interview Questions and Answers: • Advance Java Interview...
    Java 8 Interview Questions and Answers: • Java 8 Interview Quest...
    Hibernate Interview Questions and Answers:
    • Hibernate Interview Qu...
    Spring Boot Interview Questions and Answers:
    • Advance Java Interview...
    Angular Playlist: • Angular Course Introdu...
    SQL Playlist: • SQL Interview Question...
    GIT: • GIT
    Subscriber and Follow Code Decode
    Subscriber Code Decode: www.youtube.co...
    LinkedIn : / codedecodeyoutube
    Instagram: / codedecode25
    #loadbalancer #springboot #codedecode

КОМЕНТАРІ •