0
0
GCPcloud~30 mins

Serverless vs GKE decision in GCP - Hands-On Comparison

Choose your learning style9 modes available
Serverless vs GKE Decision
📖 Scenario: You are a cloud architect helping a small company decide how to deploy their new web application on Google Cloud Platform (GCP). They want to understand the difference between using a serverless approach with Cloud Run and using Google Kubernetes Engine (GKE) for container orchestration.Your task is to create a simple decision helper that models the choice between Serverless and GKE based on application needs.
🎯 Goal: Build a Python script that stores application requirements, sets a threshold for complexity, and uses a decision logic to recommend either Serverless (Cloud Run) or GKE deployment.
📋 What You'll Learn
Create a dictionary with exact application requirements and their values
Add a complexity threshold variable
Write a decision logic using an if-else statement to choose between Serverless and GKE
Output the final deployment recommendation as a variable
💡 Why This Matters
🌍 Real World
Cloud architects often need to decide the best deployment method for applications based on their requirements and complexity.
💼 Career
Understanding how to model application needs and make deployment decisions is key for roles in cloud architecture and infrastructure engineering.
Progress0 / 4 steps
1
Create application requirements dictionary
Create a dictionary called app_requirements with these exact entries: 'concurrent_users': 1000, 'cpu_intensive': false, 'requires_scaling': true, 'deployment_complexity': 3
GCP
Need a hint?

Use curly braces to create a dictionary and separate key-value pairs with commas.

2
Set complexity threshold variable
Create a variable called complexity_threshold and set it to 5
GCP
Need a hint?

Assign the number 5 to the variable named complexity_threshold.

3
Write decision logic for deployment choice
Write an if-else statement that checks if app_requirements['deployment_complexity'] is less than complexity_threshold. If true, assign 'Serverless' to a variable called deployment_choice. Otherwise, assign 'GKE' to deployment_choice.
GCP
Need a hint?

Use the if keyword to compare values and assign the correct string to deployment_choice.

4
Add final deployment recommendation variable
Create a variable called final_recommendation and set it equal to deployment_choice
GCP
Need a hint?

Assign the value of deployment_choice to final_recommendation.