Why cloud over on-premises in AWS - Performance Analysis
Start learning this pattern below
Jump into concepts and practice - no test required
We want to understand how the time it takes to manage computing resources changes when using cloud services versus on-premises setups.
Specifically, how does the effort grow as the number of servers or applications increases?
Analyze the time complexity of provisioning servers on AWS compared to on-premises.
// AWS example: Provisioning servers using EC2
for (int i = 0; i < n; i++) {
aws.ec2.runInstances({
ImageId: 'ami-123456',
InstanceType: 't3.micro',
MinCount: 1,
MaxCount: 1
});
}
// On-premises: Manually setting up each server one by one
for (int i = 0; i < n; i++) {
setupPhysicalServer();
}
This sequence shows provisioning n servers either by calling AWS API or manually setting up physical servers.
Identify the API calls, resource provisioning, data transfers that repeat.
- Primary operation: Provisioning one server instance (API call for cloud, manual setup for on-premises)
- How many times: Exactly n times, once per server
As the number of servers n increases, the total provisioning effort grows roughly in direct proportion.
| Input Size (n) | Approx. API Calls/Operations |
|---|---|
| 10 | 10 provisioning calls |
| 100 | 100 provisioning calls |
| 1000 | 1000 provisioning calls |
Pattern observation: Doubling the number of servers doubles the provisioning operations needed.
Time Complexity: O(n)
This means the time to provision servers grows linearly with the number of servers.
[X] Wrong: "Provisioning more servers in the cloud takes the same time as provisioning one server."
[OK] Correct: Each server requires its own setup call, so time grows with the number of servers, even if cloud automates some steps.
Understanding how provisioning time scales helps you explain the benefits of cloud automation and why it can be faster and easier than on-premises, even if both grow linearly.
"What if we used server templates or auto-scaling groups in the cloud? How would the time complexity change?"
Practice
Solution
Step 1: Understand cost and management differences
On-premises servers need buying, setup, and ongoing management which costs time and money.Step 2: Compare with cloud benefits
Cloud removes the need to buy physical servers and handles management, saving money and effort.Final Answer:
Because cloud lets them avoid buying and managing physical servers -> Option BQuick Check:
Cloud saves money and effort [OK]
- Thinking on-premises is always cheaper
- Confusing physical space needs
- Assuming cloud is slower
Solution
Step 1: Review cloud scaling feature
Cloud lets you increase or decrease resources quickly as your needs change.Step 2: Check other options for accuracy
Options A, B, and D are incorrect because cloud does not require buying hardware, on-premises needs internet for remote access, and updates often require manual effort.Final Answer:
Cloud allows easy scaling to match your needs anytime -> Option AQuick Check:
Cloud scaling [OK]
- Thinking cloud needs more hardware
- Believing on-premises is internet-free for remote access
- Assuming on-premises updates are automatic
Solution
Step 1: Understand cloud resource flexibility
Cloud providers allow users to add resources like storage instantly via online tools.Step 2: Contrast with on-premises process
On-premises requires buying and installing hardware, which takes time and may need downtime.Final Answer:
They can quickly increase storage through the cloud provider's console -> Option CQuick Check:
Cloud quick resource increase [OK]
- Confusing cloud with physical hardware buying
- Assuming downtime is needed for cloud scaling
- Thinking cloud scaling takes weeks
Solution
Step 1: Identify remote access requirements
On-premises servers need proper internet connection and configuration to be accessed remotely.Step 2: Evaluate options for correctness
They forgot to connect the server to the internet correctly points to missing internet connection; B and C are false statements; A is unrelated to access issues.Final Answer:
They forgot to connect the server to the internet -> Option DQuick Check:
Remote access needs internet [OK]
- Thinking cloud disallows remote access
- Assuming on-premises remote access is automatic
- Confusing hardware purchase with access issues
Solution
Step 1: Understand traffic scaling needs
A sudden increase in website visitors needs quick resource scaling to avoid slowdowns or crashes.Step 2: Compare cloud and on-premises scaling
Cloud can automatically adjust resources instantly; on-premises needs manual hardware changes which are slow and costly.Step 3: Eliminate incorrect options
Options B, C, and D are incorrect because on-premises is less flexible, cloud does not require buying extra servers upfront, and cloud access is easier.Final Answer:
Cloud can automatically scale resources up or down based on traffic -> Option AQuick Check:
Cloud auto-scaling fits sudden traffic [OK]
- Believing on-premises handles spikes better
- Thinking cloud needs pre-bought servers
- Confusing access ease between cloud and on-premises
