Cloud service models (IaaS, PaaS, SaaS) in GCP - Time & Space Complexity
Start learning this pattern below
Jump into concepts and practice - no test required
We want to understand how the work needed changes when using different cloud service models.
How does the number of tasks or calls grow as we use more resources in IaaS, PaaS, or SaaS?
Analyze the time complexity of managing resources in different cloud service models.
// Example: Creating virtual machines in IaaS
for (int i = 0; i < n; i++) {
compute.instances().insert(projectId, zone, instanceConfig).execute();
}
// In PaaS, deploy n apps using platform APIs
for (int i = 0; i < n; i++) {
appengine.apps().services().versions().create(appId, serviceId, versionConfig).execute();
}
// In SaaS, users access the software directly, no resource creation needed
// Just user requests handled by the service
This shows how many API calls happen when creating or using resources in each model.
Look at what repeats as we increase the number of resources or users.
- Primary operation: API calls to create or manage resources (virtual machines, app versions)
- How many times: Once per resource or app deployed (n times)
- In SaaS: No resource creation calls, just user requests handled by the service
As you add more virtual machines or apps, the number of API calls grows directly with that number.
| Input Size (n) | Approx. API Calls/Operations |
|---|---|
| 10 | 10 calls to create resources |
| 100 | 100 calls to create resources |
| 1000 | 1000 calls to create resources |
Pattern observation: The work grows in a straight line as you add more resources.
Time Complexity: O(n)
This means the time or calls needed grow directly with the number of resources or apps you manage.
[X] Wrong: "Adding more users in SaaS means more API calls like in IaaS or PaaS."
[OK] Correct: SaaS handles user requests internally without extra resource creation calls, so API calls don't grow the same way.
Understanding how work grows with resource use helps you explain cloud choices clearly and confidently.
"What if we batch resource creation calls instead of one per resource? How would the time complexity change?"
Practice
Solution
Step 1: Understand IaaS definition
IaaS provides virtual machines and basic infrastructure for you to manage software.Step 2: Compare with other models
PaaS manages servers for you, SaaS provides ready software, DBaaS is specialized service.Final Answer:
Infrastructure as a Service (IaaS) -> Option AQuick Check:
IaaS = Rent VMs and manage software [OK]
- Confusing PaaS with IaaS
- Thinking SaaS includes managing servers
- Mixing DBaaS as a main cloud model
Solution
Step 1: Recall PaaS meaning
PaaS lets you build and deploy apps without worrying about server management.Step 2: Eliminate incorrect options
A describes IaaS, B describes SaaS, D is not cloud service model.Final Answer:
You build and deploy apps without managing servers. -> Option CQuick Check:
PaaS = Build apps, no server management [OK]
- Confusing PaaS with IaaS
- Thinking PaaS requires software installation
- Mixing SaaS with PaaS
Solution
Step 1: Identify Google App Engine service type
Google App Engine is a platform to deploy apps without server management.Step 2: Match with cloud service models
This matches PaaS, since you build and deploy apps but don't manage servers.Final Answer:
PaaS -> Option DQuick Check:
App Engine = PaaS [OK]
- Choosing IaaS because of cloud confusion
- Selecting SaaS thinking it's ready software
- Confusing on-premises with cloud
Solution
Step 1: Understand Google Drive service type
Google Drive is ready software online, a SaaS product.Step 2: Identify the confusion
Trying to build apps on Google Drive means confusing SaaS (use software) with PaaS (build apps).Final Answer:
Confused SaaS with PaaS -> Option AQuick Check:
Google Drive = SaaS, not PaaS [OK]
- Thinking Google Drive is PaaS
- Mixing IaaS and SaaS
- Assuming all cloud is same
Solution
Step 1: Understand company needs
They want to launch app quickly without managing servers or installing software.Step 2: Match needs to GCP services and models
App Engine (PaaS) lets you deploy apps without server management. Compute Engine (IaaS) requires managing VMs. Google Workspace (SaaS) is ready software, not for custom apps. Cloud Storage is storage, not app platform.Final Answer:
App Engine with PaaS -> Option BQuick Check:
Quick app launch, no servers = PaaS (App Engine) [OK]
- Choosing Compute Engine and managing servers
- Picking SaaS for custom app building
- Confusing storage service with app platform
