ALB and NLB

ALB and NLB are both load balancers provided by AWS. ALB is an application load balancer, while NLB is a network load balancer. 


Without diving too deep into technical jargon, the key difference between the two is that ALB operates at Layer 7 of the OSI model (the application layer), while NLB operates at Layer 4 (the transport layer). 


In simpler terms, ALB is used when you need to balance traffic between multiple applications (such as different microservices) running on different servers, while NLB is used when you need to balance traffic at a lower level, such as between different ports or IP addresses. 


As for why NLB is sometimes used even though ALB seems like the more appropriate option, there could be several reasons. One reason is that NLB can handle very high amounts of traffic with very low latency, making it a good choice for certain types of applications. Additionally, NLB can handle TCP and UDP traffic, while ALB is limited to HTTP and HTTPS traffic.


Regarding your question about TCP requests, TCP is a protocol that operates at Layer 4 of the OSI model and is responsible for establishing connections between hosts and reliable data delivery. While HTTP requests from a browser do operate at Layer 7, the underlying transport protocol used to transfer the data is TCP. So, when we talk about TCP requests in the context of load balancing, we are referring to the underlying transport protocol used to transfer data between servers and clients.