Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Serverless vs PaaS vs IaaS Decision
📖 Scenario: You are working for a small company that wants to deploy a web application. The company is unsure whether to use Serverless, Platform as a Service (PaaS), or Infrastructure as a Service (IaaS) on Azure. You will help by creating a simple decision helper using Python code that models the choice based on the application's needs.
🎯 Goal: Build a Python script that helps decide between Serverless, PaaS, and IaaS based on application requirements like scalability, control, and maintenance effort.
📋 What You'll Learn
Create a dictionary with application requirements and their values
Add a configuration variable to set a threshold for high scalability need
Write logic to decide the best Azure service type based on requirements
Output the final decision as a string variable
💡 Why This Matters
🌍 Real World
Companies often need to decide which cloud service model fits their application best. This project simulates that decision-making process.
💼 Career
Cloud architects and developers must understand service models and how to choose them based on application needs.
Progress0 / 4 steps
1
Create application requirements dictionary
Create a dictionary called app_requirements with these exact entries: 'scalability': 8, 'control': 3, and 'maintenance_effort': 2.
Azure
Hint
Use curly braces to create the dictionary and separate keys and values with colons.
2
Add scalability threshold configuration
Add a variable called high_scalability_threshold and set it to 7.
Azure
Hint
This variable will help decide if the app needs very high scalability.
3
Write decision logic for service type
Write an if-elif-else block that sets a variable service_choice to 'Serverless' if app_requirements['scalability'] is greater than high_scalability_threshold, to 'PaaS' if app_requirements['control'] is greater than or equal to 5, and to 'IaaS' otherwise.
Azure
Hint
Use comparison operators and indentation carefully for the decision structure.
4
Set final decision output variable
Create a variable called final_decision and set it to the string 'Recommended Azure service: ' concatenated with the service_choice variable.
Azure
Hint
Use string concatenation with the + operator.
Practice
(1/5)
1. Which Azure service model lets you run your code without worrying about managing servers and charges you only when your code runs?
easy
A. Serverless
B. PaaS
C. IaaS
D. On-premises servers
Solution
Step 1: Understand Serverless model
Serverless runs your code without managing servers and charges based on usage.
Step 2: Compare with PaaS and IaaS
PaaS provides a platform but you still deploy apps; IaaS requires managing virtual machines.
Final Answer:
Serverless -> Option A
Quick Check:
Serverless = code runs without server management [OK]
Hint: Serverless = no server management, pay per execution [OK]
Common Mistakes:
Confusing PaaS with Serverless
Thinking IaaS is serverless
Assuming on-premises is cloud
2. Which Azure service model requires you to manage virtual machines and network settings yourself?
easy
A. Serverless
B. SaaS
C. PaaS
D. IaaS
Solution
Step 1: Identify IaaS responsibilities
IaaS gives full control over virtual machines and network settings, so you manage them.
Step 2: Contrast with other models
Serverless and PaaS abstract server management; SaaS is software delivered fully managed.
Final Answer:
IaaS -> Option D
Quick Check:
IaaS = manage VMs and network [OK]
Hint: IaaS means managing your own virtual machines [OK]
Common Mistakes:
Mixing PaaS with IaaS management level
Thinking Serverless requires VM management
Confusing SaaS with IaaS
3. You want to deploy a web app quickly without managing servers but need some control over the environment. Which Azure model fits best?
medium
A. Serverless
B. PaaS
C. IaaS
D. On-premises
Solution
Step 1: Analyze deployment needs
Quick deployment without server management suggests Serverless or PaaS.
Step 2: Consider control over environment
Serverless offers less control; PaaS provides a ready platform with some environment control.
Final Answer:
PaaS -> Option B
Quick Check:
PaaS = quick deploy + some control [OK]
Hint: PaaS balances ease and control for app deployment [OK]
Common Mistakes:
Choosing Serverless when environment control is needed
Picking IaaS for quick deployment
Confusing on-premises with cloud models
4. A developer deployed an app on Azure IaaS but forgot to configure the network security group. What is the likely issue?
medium
A. App is exposed to the internet without protection
B. App will not run because code is missing
C. Azure automatically secures the app by default
D. App will run serverless without VMs
Solution
Step 1: Understand IaaS network responsibility
In IaaS, you must configure network security groups to protect VMs and apps.
Step 2: Consequence of missing security group
Without it, the app is exposed to the internet without firewall protection.
Final Answer:
App is exposed to the internet without protection -> Option A
5. Your company needs to run a batch job that runs only a few minutes every day, with minimal management and cost. Which Azure model should you choose?
hard
A. IaaS with dedicated VMs running 24/7
B. PaaS with always-on app service
C. Serverless functions triggered by schedule
D. On-premises servers scheduled manually
Solution
Step 1: Analyze job characteristics
The batch job runs briefly daily, so paying for always-on resources wastes money.
Step 2: Match model to cost and management needs
Serverless functions run only when triggered, minimizing cost and management.