An important consideration when designing an application accessed by end users is
load balancing. Load balancing takes user requests and distributes them across
multiple instances of your application. This helps to keep your application from
experiencing performance issues if there is a spike in user activity.
Load balancing options available in Google Cloud can be divided into those that
operate at layer 7 of the OSI model and those that operate at layer 4 of the stack. As
a review, layer 7 is the the application layer of the protocol stack. It is where
applications, or processes, share data with each other. It uses lower levels of the
stack to pipe connections to other processes. The hypertext transfer protocol (http)
and file transfer protocol (ftp) are examples of Layer 7 protocols. Layer 4 of the OSI
model encapsulates host-to-host communication in both the Transport and Network
levels.
Google cloud offers both internal and external load balancers. The external load
balancers include https, SSL, and TCP load balancers. Internal load balancers include
TCP/UDP, http(s), and network pass-through load balancers.
The http(s) load balancers live at Layer 7 of the OSI model. TCP/UDP, SSL and
network load balancers reside at Layer 4 of the OSI model.
In Google Cloud, load balancers can be be proxied or pass-through. Proxied load
balancers terminate connections and proxy them to new connections internally.
Pass-through load balancers pass the connections directly to the backends.