Azure Load Balancer vs Azure Application Gateway - Part 1

2024年2月5日- By Hisham Nawzer
 

In this article, we will learn about the Azure Load Balancer and Azure Application Gateway individually and when to use which, as these two resources have features in common.

Let us go through Azure Load Balancer first. 

1. Why do we need a load balancer?

When there are multiple servers in the backend of an application, a load balancer efficiently distributes the incoming network traffic towards the backend servers. Have you recently been online shopping during the Black Friday Sale? For a web application which is accessed by many users at once, a load balancer provides numerous benefits in optimizing resource usage, minimizing response time, avoiding overload of any single resource. Most importantly, a load balancer improves the availability of a website, so that you can continue shopping without worry.

Microsoft Azure has multiple solutions for load balancing apart from Azure Load Balancer, such as Azure Application Gateway, Azure Traffic Manager and Azure Front Door [1]. This article will focus only on Azure Load Balancer and Azure Application Gateway.

2. Overview of Azure Load Balancer

Azure Load Balancer is also known as the “network layer” load balancer, as it operates at layer 4 of the OSI (Open System Interconnection) model. It provides ultra-low latency for latency sensitive applications such as gaming apps. Azure Load Balancer does not interfere with the packets which are transferred through load balancer, and it can be considered as transparent load balancer. Also, Azure Load Balancer supports multiple frontend IPs [2], so that there won’t be a need to create a new load balancer to handle a request from a new frontend IP address.

3. Components of load balancer

To understand about load balancer, it is essential to understand the key building blocks of the load balancer. The components explained here will also mostly be common with the components of Application Gateway.

3-1. Frontend

In Azure Load Balancer the front end refers to the IP address of the front-end application of which the load balancer is connected to. There are two types of frontend IPs, public and private frontend IPs. Public frontend IPs are used to create public load balancers, which can be used to balance internet traffic to the VMs, and private IP is used to build private (or internal) load balancers which are used to balance traffic inside a virtual network.

3-2. Backend Pools

This is the place where we can define the backend servers of which the requests from frontend is routed to. Azure Virtual Machines (VMs), Virtual Machine Scale sets or Public IP addresses are eligible to be defined as components of the backend pool.

3-3. Load Balancer Rules

This is where we can define the rules to route the traffic from the front end to the servers of the backend pool. As an example, we can create a rule to forward incoming requests from the frontend IP and a port to a specific backend IP Address and a port.

There are two special types of rules under the network load balancer, namely Inbound NAT rules and HA (High Availability) port rule.

Inbound NAT rules refer to forwarding a request from the front end to a specific Virtual Machine instance or an instance in the backend pool.

High availability port rule is a special rule which can be helpful in a scenario where all the ports and protocols needed to be load balanced. This enables a single rule to load balance on all ports instead of creating multiple rules related to concerned ports.

3-4. Health Probe

Health Probe is the component where the Azure Load Balancer verifies the health of each backend server instance. Azure Load Balancer will not forward any request to an unhealthy instance.

The above-mentioned components are the key components that makes an Azure Load Balancer.

The following diagrams can be used to understand the above concepts more easily.

Figure 2 - An architectural diagram showing the overall flow of how an Azure Load Balancer works [4]
Figure 1 - An architectural diagram demonstrating the concept of public and private load balancer [3]

About Rackspace

Discover the power of Rackspace Technology, brought to you by the Global Solutions Division of Iret Inc. in Japan. Elevate your cloud experience with our tailored end-to-end AWS and Microsoft Azure solutions. From expert consulting and seamless integration to cutting-edge development and daily operations, we are your dedicated partner in unleashing the full potential of the cloud. Are you ready to get started? Click the contact button below to get in touch with one of our experts.