# Introduction to Modern Network Load Balancing and Proxying ![rw-book-cover](https://readwise-assets.s3.amazonaws.com/static/images/article2.74d541386bbf.png) ## Metadata - Author: [[Matt Klein]] - Full Title: Introduction to Modern Network Load Balancing and Proxying - Category: #articles - Source: medium - Last Highlighted: 2024-10-30 10:08:51.823175+00:00 - URL: https://medium.com/p/a57f6ff80236 ## Highlights - Pedantically, not all proxies are load balancers, but the vast majority of proxies perform load balancing as a primary function - Multiplexing means sending concurrent application requests over a single L4 connection, and kept-alive means not closing the connection when there are no active requests - All modern protocols are evolving to be both multiplexing and kept-alive for efficiency reasons (it is generally expensive to create connections, especially when the connections are encrypted using TLS) - nd of course this section has just touched on HTTP; Redis, Kafka, MongoDB, etc. are all examples of L7 application protocols that benefit from L7 load balancing - As an aside, I will note that session stickiness is inherently fragile (the backend hosting the session can die), so caution is advised when designing a system that relies on them. - Passive: The load balancer detects health status from the primary data flow. e.g., an L4 load balancer might decide a backend is unhealthy if there have been three connection errors in a row. An L7 load balancer might decide a backend is unhealthy if there have been three HTTP 503 response codes in a row. - Networks are inherently unreliable and the load balancer is often responsible for exporting stats, traces, and logs that help operators figure out what is wrong so they can remediate the problem. - Additionally, for security reasons it is desirable to have a single gateway by which all Internet-facing traffic ingresses into the system. - Libraries vary greatly in supported features, but some of the most well known and feature-rich in this category are Finagle, Eureka/Ribbon/Hystrix, and gRPC (loosely based on an internal Google system called Stubby).