Cloud service models (IaaS, PaaS, SaaS) in GCP - Time & Space Complexity
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?"