0
0
AWScloud~30 mins

Serverless vs container decision in AWS - Hands-On Comparison

Choose your learning style9 modes available
Serverless vs Container Decision
📖 Scenario: You are working as a cloud architect for a small company. They want to deploy a new web application. You need to decide whether to use a serverless service like AWS Lambda or a container service like AWS Fargate. To help make this decision, you will create a simple data structure to compare the two options based on cost, scalability, and maintenance effort.
🎯 Goal: Create a dictionary with the comparison data, add a threshold for cost, filter the options based on the threshold, and finalize the decision by selecting the best option.
📋 What You'll Learn
Create a dictionary named deployment_options with exact keys and values for AWS Lambda and AWS Fargate
Add a variable named max_cost with the exact value 50
Use a dictionary comprehension named affordable_options to select options with cost less than max_cost
Add a variable named best_option that selects the option with the lowest maintenance effort from affordable_options
💡 Why This Matters
🌍 Real World
Cloud architects often need to compare different deployment methods to choose the best fit for cost, scalability, and maintenance.
💼 Career
Understanding how to structure and filter deployment options helps in making informed decisions for cloud infrastructure design.
Progress0 / 4 steps
1
Create deployment options dictionary
Create a dictionary called deployment_options with these exact entries: 'AWS Lambda': {'cost': 30, 'scalability': 9, 'maintenance': 2} and 'AWS Fargate': {'cost': 70, 'scalability': 8, 'maintenance': 5}.
AWS
Need a hint?

Use a dictionary with keys 'AWS Lambda' and 'AWS Fargate'. Each key maps to another dictionary with keys 'cost', 'scalability', and 'maintenance'.

2
Add maximum cost threshold
Add a variable called max_cost and set it to the integer 50.
AWS
Need a hint?

Just create a variable named max_cost and assign it the value 50.

3
Filter affordable deployment options
Create a dictionary comprehension called affordable_options that includes only the entries from deployment_options where the 'cost' is less than max_cost.
AWS
Need a hint?

Use a dictionary comprehension with for name, details in deployment_options.items() and filter with if details['cost'] < max_cost.

4
Select best deployment option
Add a variable called best_option that selects the key from affordable_options with the lowest 'maintenance' value.
AWS
Need a hint?

Use the min() function with a key argument to find the option with the lowest maintenance.