AWS Application Load Balancer Path Based Routing | Board Infinity (2024)

AWS Application Load Balancer Path Based Routing | Board Infinity (1)

When it comes to your HTTP and HTTPS-based application infrastructure, the load balancer is one of the significant components.

Application Load Balancer launched in 2016 supports content-based routing and works well for serverless & container-based applications, and it is highly scalable.

Often it is confusing for a novice learner to distinguish between the type of load balancers. Depending on one's use case/requirement use of load balancers can differ.

To summarize, there are three different types of load balancers in AWS Elastic Load Balancer. Classic load balancer(CLB), Network load balancer(NLB), and Application load balancer(ALB).

CLB is also known as a Classic load balancer that works on Layer 4.

ALB is also known as an Application load balancer that works on Layer 7.

NLB is also known as a Network load balancer that works on Layer 4.

In this article, we will discuss the working of an Application Load balancer with the practical demo.

1. What is a Load Balancer?

Before we discuss whatnot about the Application Load Balancer, it is crucial to understand load balancers. Without beating around the bush, the load balancer is an algorithm that balances the incoming traffic on your application.

Load balancing works on the concept of a round-robin algorithm. By this method, clients requests are routed to the available backend servers on a periodic or cyclical basis.

So a load balancer is a piece of hardware (or virtual hardware) that acts as a reverse proxy to distribute network and/or application traffic across different servers.

2. What is Path-Based Routing?

Path-based routing as the name suggests is related to some kind of path. It is nothing but the request from the ALB to different destinations.

  • Path-based routing is one of the unique features offered by Application Load Balancer.
  • Path-based routing is also referred to as URL-based routing.
  • The Application load balancer will forward the requests to the specific targets based on the Rules configured in the load balancer.

3. How does Application Load Balancer Work?

Application load balancer works at the application layer that is at the 7th layer of the OSI model.

Application Load Balancer cannot take any decisions based on port numbers, It has to check the 7th layer. After the load balancer receives a request from a client, it validates the listener rule and selects the target group.

To make it lucid, let us consider one example:

In the below architecture visualization, we can see that the request from the client contains the ( /product) inside the URL.

AWS Application Load Balancer Path Based Routing | Board Infinity (2)

So the request from the Application Load Balancer is directed to the server/pod/EC2 instance where all the product-based services of applications are running.

If the URL contains (/services) then the request would be forwarded to the EC2 instance by ALB to the Server/Instance where the services-related stuff of the application is running.

4. Configuration of Application Load Balancer

For this demo, we will launch two private EC2 instances with the apache web server in them.

Before configuring ALB we need to create a target group, To set up path-based routing we need at least two target groups.

  • Under LOAD BALANCING Click Target Groups, Select Create target group, Choose target type as Instances.
AWS Application Load Balancer Path Based Routing | Board Infinity (3)
  • Now, specify a name for the target group, and the Protocol to be HTTP and port 80. Protocol version would be the default(HTTP1). After that, we have to mention the health check path and register the instances to it.
AWS Application Load Balancer Path Based Routing | Board Infinity (4)
  • As you can see, we have created two target groups here, one of the target groups Chat Service is registered with /chat instance, and the other SearchService is registered with /search instance.
AWS Application Load Balancer Path Based Routing | Board Infinity (5)
  • Under Application Load balancer, click on create and name your load balancer and add the port that ALB would be listening on.
AWS Application Load Balancer Path Based Routing | Board Infinity (6)
  • Configure the routing, select the existing target group which we have created already. Finally, our ALB is configured.
AWS Application Load Balancer Path Based Routing | Board Infinity (7)
  • But we need to create a policy/rule for our application load balancer to perform the reverse proxy.
  • Click on the Application Load Balancer we created and select the listener tab. click on view/edit rules and add the rule for forwarding click on the insert rule to add the new rule.
AWS Application Load Balancer Path Based Routing | Board Infinity (8)
  • Select the rule type as a path and enter /chat/* in the is under forward to select the target group as ChatService.
AWS Application Load Balancer Path Based Routing | Board Infinity (9)
  • Insert one more rule having rule type as a path in the is enter /search/* and for the target group select SearchService.

Conclusion

After following this hodge-podge of steps, if you want to test if it works or not, copy the DNS name of the ALB, and paste it in the browser with /chat/ or /service/ at the end of the URL.

Enroll in the AWS Solution Architect Training Certification Course to learn directly from AWS Industry Experts & Get certified. Gain in-depth knowledge of all the topics covered in the real AWS Exam.

AWS Application Load Balancer Path Based Routing | Board Infinity (2024)
Top Articles
How to Talk About Money With Your Spouse
Episode 210 | Changing Your Focus From Money To Time | Organize365
Kostner Wingback Bed
Victor Spizzirri Linkedin
Tlc Africa Deaths 2021
Busted Newspaper Zapata Tx
Ffxiv Shelfeye Reaver
Gomoviesmalayalam
Seething Storm 5E
Evita Role Wsj Crossword Clue
Mndot Road Closures
Uvalde Topic
A.e.a.o.n.m.s
2135 Royalton Road Columbia Station Oh 44028
What Is A Good Estimate For 380 Of 60
What Time Chase Close Saturday
Foodland Weekly Ad Waxahachie Tx
National Weather Service Denver Co Forecast
Bfg Straap Dead Photo Graphic
Louisiana Sportsman Classifieds Guns
Paradise leaked: An analysis of offshore data leaks
Commodore Beach Club Live Cam
Erica Banks Net Worth | Boyfriend
China’s UberEats - Meituan Dianping, Abandons Bike Sharing And Ride Hailing - Digital Crew
Mj Nails Derby Ct
Bjerrum difference plots - Big Chemical Encyclopedia
Minnick Funeral Home West Point Nebraska
Talk To Me Showtimes Near Marcus Valley Grand Cinema
Uncovering The Mystery Behind Crazyjamjam Fanfix Leaked
1 Filmy4Wap In
Danielle Ranslow Obituary
New Stores Coming To Canton Ohio 2022
Expression Home XP-452 | Grand public | Imprimantes jet d'encre | Imprimantes | Produits | Epson France
Wheeling Matinee Results
R/Sandiego
Redding Activity Partners
Napa Autocare Locator
6465319333
Wake County Court Records | NorthCarolinaCourtRecords.us
Sephora Planet Hollywood
20 Best Things to Do in Thousand Oaks, CA - Travel Lens
Puretalkusa.com/Amac
Academic Calendar / Academics / Home
Chubbs Canton Il
Lorton Transfer Station
6463896344
Tìm x , y , z :a, \(\frac{x+z+1}{x}=\frac{z+x+2}{y}=\frac{x+y-3}{z}=\)\(\frac{1}{x+y+z}\)b, 10x = 6y và \(2x^2\)\(-\) \(...
Lsreg Att
Download Twitter Video (X), Photo, GIF - Twitter Downloader
Cool Math Games Bucketball
Latest Posts
Article information

Author: Jeremiah Abshire

Last Updated:

Views: 5714

Rating: 4.3 / 5 (74 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Jeremiah Abshire

Birthday: 1993-09-14

Address: Apt. 425 92748 Jannie Centers, Port Nikitaville, VT 82110

Phone: +8096210939894

Job: Lead Healthcare Manager

Hobby: Watching movies, Watching movies, Knapping, LARPing, Coffee roasting, Lacemaking, Gaming

Introduction: My name is Jeremiah Abshire, I am a outstanding, kind, clever, hilarious, curious, hilarious, outstanding person who loves writing and wants to share my knowledge and understanding with you.