TCP vs HTTP(S) Load Balancing.

Martin Ombura Jr.
Martin Ombura Jr.
Published in
8 min readFeb 5, 2019

--

In this article I shall show two main types of Load Balancers TCP (Layer 4) Load Balancing (L4-LBs) and HTTP(S) (Layer 7) (L7-LBs). In case you have forgotten the OSI networking model for all the network layers, check Figure 1 below.

Figure 1: OSI Network Model | Image Retrieved From Abdulaziz Hameda

You may be asking, why have a L7 and L4 LB? why not a dedicated single LB, and the answer to that depends on your infrastructure and application requirements.

HTTP(S) (Layer 7) Load Balancing

A L7-LB acts as a typical proxy that often sits between an external/global router, and your backend services. Figure 2, below showcases the program flow for a typical L7-LB. Packet A comes in from a router and is assembled, processed and manipulated by the LB. Such L7-LBs are typically implemented as software to ensure they remain flexible with regards to implementation changes and that they can scale to meet demand (See Google’s Maglev Load Balancer). This is important as organisations may want to customize the way packets are consumed and what information they can obtain from an incoming packet. The LB will then output either 1 to N number packets due to the various manipulations happening within the LB. Extra packets could’ve been created to supplement information for the backend server, or the packets could’ve been broken down into smaller packets with enriched metadata. L7-LBs can perform a…

--

--