The main purpose of the load balancer is to distribute the traffic evenly across multiple servers. The Load Balancer promises the efficient usage of the back-end servers without overloading and not keeping the server in busy times. Avoiding the server overload will reduce the downtime.
Table of Content:
- Different types of LB
- Algorithms used by ALB
- ALB Features
- Questions
- Configuring ALB in AWS
- Creating K8S config files
- Factors to consider to ALB design
There are different types of load balancers:
- Application Load Balancer (Layer 7)
- Network Load Balancer
- Global Server Load Balancer
Algorithms used by ALB are:
- Round Robin
- Least connections
- Weighted Round Robin
- IP hash
- Least Connections Response time
The ALB evaluates incoming requests to ensure efficient and reliable traffic distribution. LB has to ensure.
- High availability
- Scalability
- Performance optimization
- Health checks: The LB check the status of back servers and not responding servers are removed from pool and input requests are not shared to the failed server. This will provide the continuous availability of the application to the customer.
- Traffic distribution: Traffic routing to back servers is done using various algorithms.
- Content-based routing: The routing is done based on
- SSL certificate management:
- Session persistence/Sticky session:
Load Balancers are used in various places in the application
- Client - Web server
- Web server - Application server
- Application server - Database
Question: Is the data transfer inside the VPC secured despite the SSL termination at the load balancer?
data transfer within a VPC (Virtual Private Cloud) is generally considered secure even with SSL termination at the load balancer. Here's why:
-
Isolation: VPCs provide network isolation from other users in the cloud, meaning your traffic is not exposed to external networks.
-
Security Groups: You can control traffic between resources within your VPC using security groups, which act as virtual firewalls. This allows you to restrict communication to only necessary ports and protocols.
-
Network ACLs: Network Access Control Lists (ACLs) provide an additional layer of security by filtering traffic at the subnet level.
-
Private Subnets: You can place backend servers in private subnets, making them inaccessible directly from the internet. Only the load balancer, situated in a public subnet, would have a public IP address.
Sensitive Data & Encryption in Transit: While the traffic within the VPC is isolated, it might still be unencrypted after SSL termination. If you have strict compliance requirements or are dealing with highly sensitive data, you might consider end-to-end encryption (i.e., having SSL/TLS on both the load balancer and backend servers).
-
Sometimes to follow the same standard across the organization and follow the encryption in all endpoints, do not do SSL termination in load balancer and allow the SSL encryption to continue/pass through. The extra burden is managing the SSL certificates and rotation.
Question: What will happen if ALB itself fails?
Several strategies provide redundancy and automatic failover mechanisms.
- Load Balancer Redundancy
- Active-Active configuration
- Active-Passive configuration
- Health checks and Monitoring
- Frequency health check
- Failover mechanism
- Use managed Load Balancer service of cloud providers.
Factors to consider to design a load balancing solution to meet the requirements of the application characteristics such as performance, scalability, security and reliability
- Do you need L4 or L7 load balancing
- What are the out of box features required for your use case (e.g., health checks, stick sessions, SSL termination)
- How much traffic need to handle ?
- Do you need LB to be scalable based on custom parameters?
- High availability and scalability
- Performance optimization
- Monitoring and logging
- Are you using Websockets and gRPC ?
- Cost of using on-premises vs managed load balancer & choosing the computation.
Configuring ALB on AWS & The K8S config files https://www.github.com/bonu/
References:
- The 5 Best Open Source Load Balancers: https://logz.io/blog/best-open-source-load-balancers/
- 4 Best Open Source Load Balancers in 2024: https://betterstack.com/community/comparisons/best-load-balancers/
Comments
Post a Comment