0
0
AWScloud~30 mins

ALB vs NLB decision in AWS - Hands-On Comparison

Choose your learning style9 modes available
ALB vs NLB Decision
📖 Scenario: You are working as a cloud architect for a company that needs to set up load balancing for their web applications. They want to understand when to use an Application Load Balancer (ALB) versus a Network Load Balancer (NLB) in AWS.Your task is to create a simple decision helper in Python that helps decide which load balancer to use based on the application requirements.
🎯 Goal: Build a Python script that stores application requirements and uses simple logic to decide whether to use an ALB or NLB.
📋 What You'll Learn
Create a dictionary with application requirements
Add a configuration variable for traffic type
Write logic to decide ALB or NLB based on traffic type
Output the final decision as a variable
💡 Why This Matters
🌍 Real World
Choosing the right AWS load balancer is important for application performance and cost optimization.
💼 Career
Cloud architects and engineers often need to decide between ALB and NLB based on application needs.
Progress0 / 4 steps
1
Create application requirements dictionary
Create a dictionary called app_requirements with these exact entries: 'protocol': 'HTTP', 'port': 80, 'target_type': 'instance'
AWS
Need a hint?

Use curly braces to create a dictionary with keys and values exactly as shown.

2
Add traffic type configuration
Add a variable called traffic_type and set it to the string 'HTTP'
AWS
Need a hint?

Assign the string 'HTTP' to the variable traffic_type.

3
Write decision logic for load balancer
Write an if statement that sets a variable load_balancer_choice to 'ALB' if traffic_type is 'HTTP', otherwise set it to 'NLB'
AWS
Need a hint?

Use an if-else statement to assign the correct load balancer choice based on traffic_type.

4
Set final decision variable
Add a variable called final_decision and set it equal to load_balancer_choice
AWS
Need a hint?

Assign the variable final_decision to the value of load_balancer_choice.