ELB Overview
- Use to forward traffic to multiple servers
- Expose single point of access
DNSto the application - Do regular health checks
- Provide
SSLfor the site - Can be used stickiness with cookies
- User with same cookie will go to the same server/instance
- Allow cross zone availability
- 3 types of load balancers
- Classic Load Balancer
- Handle
HTTP,HTTPSandTCPtraffic
- Handle
- Application Load Balancer
- Handle
HTTP,HTTPSandWebsocket - Great fit for micro-services and container based applications
- Has port mapping feature to redirect a dynamic port in
ECS - The application can get the IP from header
x-forwarded-for - The application can get the protocol from header
x-forwarded-proto - The application can get the port from header
x-forwarded-port
- Handle
- Network Load Balancer
- Handle
TCP,TLSakaSecure TCPandUDP - Supports one EIP for each AZ, that is helpful for whitelisting the IP
- Use for
- Extreme performance
- TCP or UDP protocol
- Handle
- ALB and CLB expose DNS, on the other hand NLB expose static IP
- Load balancer can be
PublicandPrivate - For huge scale out, need to use
warm-up. Need to contact AWS for this purpose - Troubleshooting
- 4xx for client induced error
- 5xx for application induced error
- 503 for
at capacityorno registered target - Monitoring
ALBaccess logs can provide details ofAPI Calls- Cloudwatch for aggregate statistics
ELBdoes the health check by- HTTP
- HTTPS
- A security feature is
Perfect forward secrecy - offer SSl/TLS to
CloudfrontandELB - In ALB
- using path condition we can forward request to different
Target Groupsbased on api path, like- abc.com/a
- abc.com/b
- using host condition we can forward request to different
Target Groupsbased on host name in the header, like- abc.site.com
- def.site.com
ALBcan have 3 types of target,- Instances
- IP
- Lambda
Stickiness
- Ensure the user goes to the same instance
- Supported by
- Application Load Balancer
- Need to update the target group
- Classic Load Balancer
- Can set the time of stickiness
Cross Zone Load Balancing
- Load balancer can distribute traffic evenly among all the AZ
- For
NLBthere is charge forInter AZload balancing - In
CLBandNLBthisCross Zone Load Balancingis turned of by default
SSL and TLS Certificate
- SNI stands for server name identification
- SNI can be use for multiple endpoint with multiple certificate
Connection Draining
- It is the time of
In Flight Requestwhile the instance isde registeringorunhealthy - For
CLBit is calledConnection Draining - For
ALBandNLBit is calledDe registration Delay - Happen in
Target Group - Connection draining time can be set from 0 (disabled) to 3600 sec
Lambda Function Integration
With ALB and target groups,
- We can send multi value headers
- Enable health check
multi value query enables us sending query as
name=['foo', 'bar']instead of?name='foo'&name='bar'