All technological notes.
Elastic Load BalancerLoad Balancers are servers that forward traffic to multiple servers (e.g., EC2 instances) downstream
Purpose

An Elastic Load Balancer is a managed load balancer
It costs less to setup your own load balancer but it will be a lot more effort on your end
It is integrated with many AWS offerings / services



AWS has 4 kinds of managed Load Balancers
Classic Load Balancer (v1 - old generation) – 2009 – CLB
Application Load Balancer (v2 - new generation) – 2016 – ALB
Network Load Balancer (v2 - new generation) – 2017 – NLB
Gateway Load Balancer – 2020 – GWLB
Supports
Health checks:
Fixed hostname

Application Load Balancer (v2)Feature
Expose:
Support
HTTP/2 and WebSocketHTTP to HTTPS for example)Routing tables to different target groups based on:
In comparison, we’d need multiple Classic Load Balancer per application
HTTP Based Traffic diagram:

Query Strings/Parameters Routing

Good to Know
X-Forwarded-For in the headerX-Forwarded-Port in the headerX-Forwarded-Proto in the header
Target Group of ALB can be:
HTTPHTTPHealth checks are at the target group level
Health Checks


















Network Load Balancer (v2)Network load balancers (Layer 4) allow to:
Not included in the AWS free tier

Target Group:















Gateway Load BalancerOperates at Layer 3 (Network Layer) – IP Packets
Combines the following functions:
Transparent Network Gateway:
Load Balancer
Uses the GENEVE protocol on port 6081

Target Group


Classic Load Balancer, Application Load Balancer, and Network Load Balancer
Application-based Cookies
Application cookie
Custom cookie
Duration-based Cookies










An SSL Certificate allows traffic between your clients and your load balancer to be encrypted in transit (in-flight encryption)
SSL: Secure Sockets Layer, used to encrypt connectionsTLS: Transport Layer Security, which is a newer versionTLS certificates are mainly used, but people still refer as SSLCertificate Authorities (CA)
ACM (AWS Certificate Manager)You can create upload your own certificates alternatively
SNI (Server Name Indication) to specify the hostname they reach
Classic Load Balancer (v1)
Application Load Balancer (v2)
Server Name Indication (SNI) to make it workNetwork Load Balancer (v2)
Server Name Indication (SNI) to make it workSNI solves the problem of loading multiple SSL certificates onto one web server (to serve multiple websites)



Feature naming 在不同的 balancer 中有不同的名称
Connection Draining
Parameterize
