Load Balanced Architecture with Advanced Request Routing (2024)

Please use the menu below to navigate the article sections:

  • Advantages of joining a Bootcamp
    • Sense of community
    • Career tips
    • Step-by-step guidance
    • One-on-one assistance
    • A realistic path to employment
  • Load Balanced Architecture with Advanced Request Routing
  • Exercise 1 –Create the Red and Blue EC2 instances
  • Exercise 2 – Enable Path-based Routing
  • Exercise 3 – Enable Host-based Routing
  • Exercise 4 – Clean up your resources
  • Become an AWS expert with our value-packed training
Load Balanced Architecture with Advanced Request Routing (1)

One of the main challenges when learning Cloud Computing is to build hands-on experience. When learning only the theory, one may end up struggling when it comes to implementing cloud solutions in the real world. That’s why here at Digital Cloud Training we have a strong focus on hands on lessons throughout the video courses we provide for AWS Certifications.

Recently, we decided to take this to another level, by introducing AWS Bootcamps. We currently offer two bootcamps which are aligned with two certifications (AWS Certified Cloud Practitioner and AWS Certified Solutions Architect Associate). With these bootcamps, you not only develop the fundamental cloud skills you need to pass the AWS exam, but also learn how to build real-life, scalable and highly complex applications with a broad range of AWS Services.Let’s explore how you could benefit from joining an AWS Bootcamp.

Advantages of joining a Bootcamp

Sense of community

When participating in an AWS Bootcamp with Digital Cloud Training, you get to be surrounded by like minded individuals – all aspiring to get into the cloud or level up their cloud career. You will be able to network, share tips and build a group of people who you can help inspire – and be inspired by.

Career tips

Career preparedness sessions play an important part in our bootcamps. You get tailored advice on how to kick-start your cloud career in AWS. Learn from industry experts who can give advice on how to get your CV to the top of the pile and how to network effectively on LinkedIn. These hacks will put you in a better position to find employment in the Cloud.

Step-by-step guidance

With a structured training plan, there is no guess work in what steps to take on your way to success. A blend of self-paced video courses, virtual lab exercises paired with multiple live interactive sessions every week will help you develop experience and gain confidence. This is a perfect opportunity for those who are unsure of how to start your cloud journey.

One-on-one assistance

Bootcamp members enjoy one-on-one sessions with cloud experts whom they can ask anything from how to find a job, technical questions, etc. They get direct support and advice from people who currently work in the AWS cloud.

A realistic path to employment

The perpetual dilemma of landing a job which requires experience – whilst you have no experience – can be difficult to get past. Our hands-on bootcamp will give you the skills and knowledge needed to build scalable and realistic solutions on the cloud, using our live labs and real-world projects.

So without further ado, here is a taster of a lab lesson which our students built in a live communal environment in one of our most recent AWS Solutions Architect Associate Bootcamps.

Load Balanced Architecture with Advanced Request Routing

This lab guide from our AWS Solutions Architect Associate Bootcamp, creates a simple website, hosted on EC2, behind an Application Load Balancer. Host-based and path-based routing rules will then be configured to route based on information in the host header or URL path.

Host-based routing allows you to route to multiple domains on a single load balancer by routing to a different set of EC2 instances or containers based on information in the host header.

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 on the load balancer.

Requirements (Prerequisites)

  • AWS Free Tier Account
  • Basic Exposure to the AWS Console
  • Follow the steps in Section 8 of the AWS Solutions Architect video course to register your own domain name in Route 53

Resources

Download the “code-advanced-request-routing.zip” file.

Exercise Overview

Exercise 1 – Create the Red and Blue EC2 instances
Exercise 2 – Enable Path-based Routing
Exercise 3 – Enable Host-based Routing
Exercise 4 – Clean up your resources

Exercise 1 –Create the Red and Blue EC2 instances

Task 1 – Create the S3 Bucket and Upload the code

The first step is to upload the code we will use to create the websites into an S3 bucket.

  1. Go to the S3 console and click ‘Create Bucket’.
  2. We will call out bucket ‘advanced-request-routing-123456’ with the numbers at the end being random to make the bucket globally unique. Take a note of the bucket name as will be referring to it again shortly.
  3. Scroll down and click ‘Create Bucket’.
  4. Locate the files we have downloaded as part of the course and select all files except the user data files and bucket-permissions file and upload them to the bucket.

Task 2 – Create your Security Group

The second step is to pre-emptively create the Security Group for your EC2 instances.

  1. Go to the EC2 console, scroll down to the ‘Security Group’ column under ‘Network Security’. Click ‘Create Security Group’. We will call it ‘WebsiteSG’. Populate the description field with ‘WebsiteSG’ also.
  2. Under inbound rules – simply add one rule:
  1. This is an HTTP rule, with an ‘Anywhere IPv4’ source. Create the Security Group.

Task 3 – Create the Red EC2 instance.

We will now launch the ‘Red’ EC2 instance and check to see if it has successfully retrieved the code from S3.

  1. Head over to the EC2 console and select ‘Launch Instance’.
  2. Call your first instance ‘Red’.
  3. Select the AMI, and under ‘Instance type’, select ‘t2.micro’.
  4. For ‘Key pair’, leave the default setting ‘Proceed without a key pair’.
  5. Under ‘Network settings’ select the security group you created earlier and choose the subnet us-east-1a.
  6. Expand ‘Advanced Details’ and under ‘IAM instance profile’ select ‘Create a new IAM profile.’
  7. A new page will open. Click ‘Create Role’.
  8. Under common use cases, select ‘EC2’ and click next.
  9. Click ‘Create Policy’ and move to the JSON section. Copy and paste the code from the bucket-permissions.json file into the code window, replacing the your-bucket-arn with the ARN of the bucket you have just made.
  10. Click review policy, and create policy, call it ‘mys3to3c2policy’.
  11. Go back to where we are creating the role, refresh the policies and find and select the policy we just created. Click next and call it ‘mys3to3c2role’.
  12. Go back to the launch instance page, and refresh the IAM instance profile, and locate the role, and click attach.
  13. Next, copy the user data from the ‘user-data-red’ file into the ‘User data’ field. It should look like the image below. You will also need to edit the name ‘dctlabs’ in the user data to the name of your S3 bucket.
  14. Create the instance.
  15. Follow the exact same steps to create the Blue instance with the blue user data (user-data-blue) and select subnet us-east-1b. You should then be able to get the public IP address from either instance and view the web pages created by each EC2 instance. You will need to add /blue and /red to the appropriate instance to return the custom web page.

Exercise 2 – Enable Path-based Routing

With path-based routing we will enter a path to our URL and the load balancer will route the request to the appropriate target group based on the rules we create. The architecture looks like this:

Load Balanced Architecture with Advanced Request Routing (2)

Task 1 – Create your target groups

The first step is to set up the target groups; you need at least 2 target groups to configure path-based routing.

  1. To start things off, click on Target Groups under Load balancing.
  2. Click ‘Create target group.’
  3. Set up 2 target groups, one is called ‘Red’ which will contain the red targets, and the other is called ‘Blue’ and will contain the blue targets.
  4. Leave all the defaults, except changing the target group name to ‘Red’ / ‘Blue’ and change the health check to:
    1. For Red: /red/index.html
    2. For Blue: /blue/index.html
  5. Register the correct instance i.e., Red and be sure to click ‘include as pending below’.

Task 2 – Create your Application Load Balancer

The next step is to create the Application Load Balancer.

  1. On the left-hand side of the EC2 console, you will find the link for Load Balancers.
  2. Click ‘Create Load Balancer’ and choose the ‘Application Load Balancer’.
  3. Call the load balancer ‘LabLoadBalancer’ and leave the Scheme as Internet Facing.
  4. Select both us-east-1a and us-east-1b for the subnet mappings. This will allow routing of traffic across the instances in different AZs.
  5. Choose the same Security Group as earlier (WebsiteSG).
  6. Choose the listener and routing as HTTP: 80 and choose the Blue Target Group.
  7. Click Create load balancer and wait a few minutes for it to turn from ‘Provisioning’ to ‘Active’.
  8. Once active, under Listeners, select the first listener rule and click ‘View/Edit Rules’.
  9. Edit the paths.
    Click the + sign on top and click ‘Insert Rule’ then select the Rule type as Path, enter /red*, select the target group ‘Red’ in the ‘Forward to’ column.
    Click Save, insert another rule, and configure forwarding to the Blue target group too. The configuration should look like the image below:
    Load Balanced Architecture with Advanced Request Routing (3)
  10. We can then test the load balancer’s path-based routing by copying the DNS name from the Application Load Balancer and append either /blue or /red on the URL and see what happens. You should see the different colored custom web pages we added to our instances.

Exercise 3 – Enable Host-based Routing

With host-based routing we will enter a subdomain to the domain name and the load balancer will route the request to the appropriate target group based on the rules we create. The architecture looks like this:

Load Balanced Architecture with Advanced Request Routing (4)

Task 1 – Edit host-based forwarding rules

The first step is to set up the forwarding rules. You need at least 2 target groups to configure host-based routing.

  1. Click on the Load Balancer name and then go to the Listeners tab
  2. Click on ‘View/Edit rules’ under ‘Rules’ column.
  3. Remove the path-based routing rules created earlier.
  4. Click on the ‘+’ symbol followed by ‘Insert Rule’.
  5. Under the ‘IF(all match) column, click on the ‘+ Add condition’ drop-down arrow and select ‘Host header’ as the Rule type and put your domain name with the blue or red subdomains in front. For example, blue.dctcloudlabs.com and red.dctcloudlabs.com
  6. In the ‘Then’ column, click on ‘+Add action’ drop-down arrow and select ‘Forward to’ as the action. Here select the appropriate target group (Red / Blue).
  7. Make sure you repeat the above to have one rule for each target group / subdomain.

The rules should look like this:

Load Balanced Architecture with Advanced Request Routing (5)

Task 2 – Configure Records in Route 53

In this task we need to create the relevant subdomain DNS records in Amazon Route 53 and configure the load balancer as the target.

  1. Open Route 53 dashboard from the management console, find your public domain name under hosted zones. Click on it and select ‘Create Record.’
  2. Enter various details for this record:

subdomain: blue or red

Record type: Select A type here.

Value/Route traffic to:

Select ‘Alias to Application and Classic Load Balancer’

Select region N.Virginia

Select the target load balancer we made earlier. It should look like this.

Load Balanced Architecture with Advanced Request Routing (6)

  1. Finally hit ‘Define simple record’.
  2. Make sure you repeat the above steps to ensure you have one DNS record for each of the blue and red subdomains.
  3. The DNS records will look like this:Load Balanced Architecture with Advanced Request Routing (7)
  4. To check if everything is working as expected, open a web browser, and paste the DNS name of the load balancer and append it with either Red or Blue, like this:

red.mydomainname.com/red

blue.mydomainname.com/blue

You should see the webpages load and be populated with content. Bear in mind that the custom web pages exist under the /blue and /red paths, so you’ll need to add those to see that the correct pages are loading.

Exercise 4 – Clean up your resources

Task 1 – Delete your resources

You can now delete the resources you created:

  • Application Load Balancer (chargeable).
  • Target groups (not chargeable).
  • Security Group (not chargeable).
  • Amazon EC2 Instances (chargeable).
  • Amazon S3 bucket (chargeable).
  • Amazon Route 53 Alias records (not chargeable).

Become an AWS expert with our value-packed training

AWS Training– Our popular AWS training will maximize your chances of passing your AWS certification the first time.
Membership– For unlimited access to our entire cloud training catalog, enroll in our monthly or annual membership program.
Challenge Labs– Build hands-on cloud skills in a secure sandbox environment. Learn, build, test and fail forward without risking unexpected cloud bills.

Related posts:

Load Balanced Architecture with Advanced Request Routing (2024)

FAQs

What is the difference between routing and load balancing? ›

Routing makes a decision on where to forward something – a packet, an application request, an approval in your business workflow. Load balancing distributes something (packets, requests, approval) across a set of resources designed to process that something. You really can't (shouldn't) substitute one for the other.

What are the three types of AWS load balancers? ›

Further aiding your availability, AWS Elastic Load Balancing supports three types of load balancers: Application Load Balancers, Network Load Balancers, and Classic Load Balancers.

Which load balancer supports content based routing? ›

Content-based Routing

If your application is composed of several individual services, an Application Load Balancer can route a request to a service based on the content of the request such as Host field, Path URL, HTTP header, HTTP method, Query string or Source IP address.

Which load balancer is best suited for HTTP and HTTPS load balancing traffic? ›

A: An Application Load Balancer supports load balancing of applications using HTTP and HTTPS (Secure HTTP) protocols.

Which load balancing method is best? ›

Round Robin load balancing method

Round-robin load balancing is the simplest and most commonly-used load balancing algorithm. Client requests are distributed to application servers in simple rotation.

Can a router be used as a load balancer? ›

Load balancers are routers. Typically they route high volume traffic between almost identical endpoints. To provide "balance" and "availability". Routing service is more general.

Which routing protocol supports load balancing? ›

EIGRP provides unequal-cost load balancing and rapid convergence.

What is the main difference between a load balancer and a network load balancer? ›

These load balancers use different types of algorithms to distribute traffic evenly to their targets. An ALB uses a round-robin algorithm by default, routing traffic one after another. However, an NLB uses a flow hash algorithm so that traffic is routed to specific targets in a predetermined manner.

What is the difference between load balancer and routing in Route 53? ›

ELBs are intended to load balance across EC2 instances in a 'single' region. Whereas DNS load-balancing (Route 53) is intended to help balance traffic 'across' regions. Route53 policies like geolocation may help direct traffic to preferred regions, then ELBs route between instances within one region.

How many requests can a load balancer handle? ›

Application Load Balancers support the following protocols on front-end connections: HTTP/0.9, HTTP/1.0, HTTP/1.1, and HTTP/2. You can use HTTP/2 only with HTTPS listeners, and can send up to 128 requests in parallel using one HTTP/2 connection.

Which protocol is used for load balancing? ›

A TCP Load Balancer uses transmission control protocol (TCP), which verifies information sent to internet protocol (IP) addresses. It ensures the data arrives error-free to non-HTTP applications.

Can I use NGINX as a load balancer? ›

NGINX and NGINX Plus can be used in different deployment scenarios as a very efficient HTTP load balancer.

What is load balancing in routing protocols? ›

Load Balancing Definition: Load balancing is the process of distributing network traffic across multiple servers. This ensures no single server bears too much demand. By spreading the work evenly, load balancing improves application responsiveness. It also increases availability of applications and websites for users.

What is load balancing in simple terms? ›

Load balancing is the method of distributing network traffic equally across a pool of resources that support an application. Modern applications must process millions of users simultaneously and return the correct text, videos, images, and other data to each user in a fast and reliable manner.

What is the difference between load balancing and load balancer? ›

Load balancing is handled by a tool or application called a load balancer. A load balancer can be either hardware-based or software-based. Hardware load balancers require the installation of a dedicated load balancing device; software-based load balancers can run on a server, on a virtual machine, or in the cloud.

What is load balancing for a bank? ›

Load balancing — which may also be referred to as volume distribution or transaction routing — is used to spread transactions across multiple merchant accounts to reduce the likelihood that any one account breaches card brand thresholds.

Top Articles
When will I get my first payment?
What Is Binance and Are Your Crypto Holdings Safe There?
Tattoo Shops Lansing Il
Craigslist Home Health Care Jobs
Otis Department Of Corrections
Bellinghamcraigslist
Corporate Homepage | Publix Super Markets
Bros Movie Wiki
Citymd West 146Th Urgent Care - Nyc Photos
Nonne's Italian Restaurant And Sports Bar Port Orange Photos
Accuradio Unblocked
Highland Park, Los Angeles, Neighborhood Guide
CANNABIS ONLINE DISPENSARY Promo Code — $100 Off 2024
Kaitlyn Katsaros Forum
Beverage Lyons Funeral Home Obituaries
Reborn Rich Kissasian
A Person That Creates Movie Basis Figgerits
Craigslistodessa
How to Watch Every NFL Football Game on a Streaming Service
Jackie Knust Wendel
From This Corner - Chief Glen Brock: A Shawnee Thinker
Craigslist Rentals Coquille Oregon
Top 20 scariest Roblox games
Mumu Player Pokemon Go
Vistatech Quadcopter Drone With Camera Reviews
Bt33Nhn
Shoreone Insurance A.m. Best Rating
Usf Football Wiki
Bismarck Mandan Mugshots
Craigslist List Albuquerque: Your Ultimate Guide to Buying, Selling, and Finding Everything - First Republic Craigslist
The Minneapolis Journal from Minneapolis, Minnesota
Kelley Blue Book Recalls
3496 W Little League Dr San Bernardino Ca 92407
Red Dead Redemption 2 Legendary Fish Locations Guide (“A Fisher of Fish”)
Craigslist Boats Dallas
QVC hosts Carolyn Gracie, Dan Hughes among 400 laid off by network's parent company
Lucifer Morningstar Wiki
Powerspec G512
Denise Monello Obituary
Yourcuteelena
Haunted Mansion (2023) | Rotten Tomatoes
Best Haircut Shop Near Me
Stitch And Angel Tattoo Black And White
Accident On 40 East Today
Dancing Bear - House Party! ID ? Brunette in hardcore action
Underground Weather Tropical
1Tamilmv.kids
Home | General Store and Gas Station | Cressman's General Store | California
Hy-Vee, Inc. hiring Market Grille Express Assistant Department Manager in New Hope, MN | LinkedIn
Predator revo radial owners
Fishing Hook Memorial Tattoo
How to Choose Where to Study Abroad
Latest Posts
Article information

Author: Mrs. Angelic Larkin

Last Updated:

Views: 6000

Rating: 4.7 / 5 (47 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Mrs. Angelic Larkin

Birthday: 1992-06-28

Address: Apt. 413 8275 Mueller Overpass, South Magnolia, IA 99527-6023

Phone: +6824704719725

Job: District Real-Estate Facilitator

Hobby: Letterboxing, Vacation, Poi, Homebrewing, Mountain biking, Slacklining, Cabaret

Introduction: My name is Mrs. Angelic Larkin, I am a cute, charming, funny, determined, inexpensive, joyous, cheerful person who loves writing and wants to share my knowledge and understanding with you.