Load Balancers on GCP in a nutshell
#Coffee shop analogy
Coffee Shop (Java Analogy Scenario), the employee is a metaphor for the client server model, where a client sends requests to the server, the server does some work and then sends a response to the client. This example is for the coffee shop but the same idea applies to other business models, Your business, whether it be in healthcare, manufacturing, insurance, or delivering video content to millions of users all around the world. Are also using this model to deliver products, Resources or data to your end users.
Many of you choose to develop serverless applications on Google Cloud so that you don’t have to worry about provisioning and managing the underlying infrastructure. In addition, serverless applications scale on-demand so you only pay for what you use. But historically, serverless products like App Engine used a different HTTP load balancing system than VM-based products like Compute Engine. Today, with new External HTTP(S) Load Balancing integration, serverless offerings like App Engine (standard and flex), Cloud Functions and Cloud Run can now use the same fully featured enterprise-grade HTTP(S) load balancing capabilities as the rest of Google Cloud.
Load Balancer is the tool to manage the network traffic and distribute it across multiple servers in a cloud environment. Load balancing is the process of distributing traffic across your network of servers to ensure that the system does not get overwhelmed and all requests are handled easily and effeciently.
Load Balancer is implemented in the transport layer i.e. the Layer 4 of the Open System Interconnection(OSI) Model. It uses a hashing algorithm to distribute the inbound traffic flow. Five tuple hash algorithms are used here. It helps in mapping traffic to the accessible servers. Its components are Source IP address, Source port, Destination IP address, Destination port and IP protocol number to map flows to available servers.
Why is load balancing important?
There are a number of reasons why load balancing is important. Load balancer lets you:
- Distribute load-balanced resources in single or multiple regions
- Meet your high availability requirements
- Scale your resources up or down with intelligent Autoscaling
- And use cloud content delivery network (CDN) for optimal content delivery
With Google Cloud Load Balancing, you can serve content as close as possible to your users, on a system that can respond to over 1 million queries per second!
Different load balancing options
To decide which load balancer best suits your implementation, you need to think about whether you need
- Global or regional load balancing. Global load balancing means backend endpoints live in multiple regions. Regional load balancing means backend endpoints live in a single region.
2. External or internal load balancing
3. What type of traffic are you serving? HTTP, HTTPS, SSL, TCP, UDP etc.
How to decide which load balancer to use?
So clearly, for Beyond Treat, there are many Load Balancing options depending on where exactly you need a load balancer in the architecture.
You would use external load balancers to distribute traffic coming from the internet to their Google Cloud network and internal load balancers to distribute traffic within their GCP network.
External load balancer
External load balancing includes four options:
- HTTP(S) Load Balancing for HTTP or HTTPS traffic,
- TCP Proxy for TCP traffic for ports other than 80 and 8080, without SSL offload
- SSL Proxy for SSL offload on ports other than 80 or 8080.
- Network Load Balancing for TCP/UDP traffic.
Network load balancer
While the global HTTP(S) load balancer is for Layer-7 traffic and is built using the Google Front End Engines at the edge of Google’s network, the regional Network Load Balancer is for Layer-4 traffic and is built using Maglev.