Sub topic 2
The Essential Characteristics: On-Demand, Elastic, Measured
This chapter assumes you know what a server, an operating system, and an application are. It also assumes you are comfortable with basic networking terms such as IP address and HTTP. By the end, you will be able to test any service against the essential characteristics of cloud computing and explain why a hosted server alone does not qualify.
Why a definition by characteristics
"The cloud" is often used to mean "someone else's computer." That description is too loose. A server you rent from a hosting company on a 12-month contract is someone else's computer, but it behaves very differently from a cloud service.
The most widely used definition comes from the US National Institute of Standards and Technology (NIST), in its publication SP 800-145. NIST does not define the cloud by what it is made of. It defines it by five behaviors a service must show. These are the essential characteristics:
- On-demand self-service
- Broad network access
- Resource pooling
- Rapid elasticity
- Measured service
This chapter covers four of them in detail: on-demand self-service, broad network access, rapid elasticity, and measured service. Resource pooling depends on virtualization, so the next chapter covers it.
On-demand self-service
On-demand self-service means you can provision computing resources yourself, when you need them, without talking to a person at the provider.
"Provision" means to create and make a resource ready for use. In a traditional data center, getting a new server could take weeks. You filed a ticket, someone approved a purchase, hardware arrived, and an administrator installed it. In the cloud, you call an API or click a button, and the resource exists within seconds or minutes.
The command below asks for one small virtual machine. It uses the AWS CLI, and the image ID is a placeholder, so substitute an image that exists in your region.
# The AMI ID below is a placeholder; use an image ID that exists in your region.
aws ec2 run-instances \
--image-id ami-0123456789abcdef0 \
--instance-type t3.micro \
--count 1Nobody at the provider reviewed this request. Your credentials, your account limits, and your permissions decided whether it succeeded. The key points are:
- Self-service means the consumer starts and stops resources without human help from the provider.
- On-demand means resources are available when requested, not scheduled in advance.
- Everything is an API call underneath. The web console, the CLI, and infrastructure-as-code tools all send API requests. This is why cloud resources can be automated.
Limits on "on demand"
On-demand does not mean unlimited. Accounts have quotas, such as a maximum number of vCPUs per region. A request can also fail with a capacity error if the provider has no free hardware of that type in the zone you chose. Quotas protect you from runaway cost and protect the provider from abuse, and you can usually request increases.
Broad network access
Broad network access means resources are reachable over the network through standard mechanisms, from many kinds of client devices: laptops, phones, servers, and other services.
In practice this means HTTP APIs, SSH, and web consoles over the internet or a private network link. You do not need to be in the building where the hardware sits. The location of the machine is mostly irrelevant to how you use it.
This characteristic has a side effect you should keep in mind. If everything is reachable over a network, then access control and network configuration become your main line of defense. A storage bucket or database exposed by a configuration mistake is reachable from anywhere. Later chapters on shared responsibility return to this.
Rapid elasticity
Elasticity is the ability to grow and shrink the resources allocated to a workload quickly, ideally automatically, as demand changes. To the consumer, capacity appears nearly unlimited and can be acquired in any quantity at any time.
Two terms are often confused:
| Term | Meaning | Example |
|---|---|---|
| Scalability | The system can handle more load if you add resources | A database that can move to a bigger machine |
| Elasticity | Resources are added and removed quickly to follow load | An autoscaling group that adds servers at noon and removes them at night |
A system can be scalable without being elastic. If adding capacity needs a three-week purchase process, the system scales but is not elastic. Elasticity is scalability plus speed plus the ability to release capacity again.
Two directions of scaling
- Vertical scaling (scaling up) means moving to a larger machine, for example from 2 to 16 GB of memory. It is simple but usually requires a restart and has an upper limit.
- Horizontal scaling (scaling out) means adding more machines and sharing the load among them. It scales further but requires the application to work across several instances, for instance by keeping no user session data only on one server.
The cost of fixed capacity
Without elasticity you must provision for the peak. Suppose a shop needs 20 servers for a few hours on a sale day and 4 servers the rest of the time. With fixed capacity it owns 20 servers all year. With elastic capacity it pays for 4 most of the time and 20 only during the peak.
The diagram below shows the gap between fixed capacity and elastic capacity over one day.
The lower line is demand, which elastic capacity can follow. The flat line at 20 is what a fixed setup must hold. The area between the two lines is paid-for capacity that sits idle.
Elasticity in practice
In AWS, an Auto Scaling group adds or removes EC2 instances based on a policy. A target tracking policy, for example, tries to keep average CPU use near 50 percent. When load rises, it launches instances. When load falls, it terminates them.
Elasticity has real limits:
- Startup time. A new instance needs time to boot and warm up. A sudden spike can still overload your system before new capacity arrives.
- Application design. Instances that hold local state cannot be removed safely.
- Downstream bottlenecks. Adding web servers does not help if a single database is the limit.
- Quotas and capacity. The provider's limits apply, as described earlier.
Measured service
Measured service means the provider automatically monitors, controls, and reports resource use, and the consumer sees the same data. Usage is metered, like electricity or water.
Metering is what makes the other characteristics economically workable. If you can create and destroy resources in seconds, a fixed monthly fee would make no sense. Instead you are billed by what you use, with units that depend on the resource:
- Compute: seconds or hours of running time, by instance size.
- Storage: gigabytes stored per month.
- Network: gigabytes transferred out of the provider.
- Requests: number of API calls or function invocations.
Measurement also supports operations. Metrics such as CPU use feed autoscaling decisions. Usage reports support budgeting, alerts, and showing which team spent what. Chapter material on billing later in this tutorial covers pricing models in detail.
A small example shows the effect. Assume a server costs $0.10 per hour.
HOURLY_RATE = 0.10 # dollars per server-hour (example figure)
# Fixed capacity: 20 servers running all day.
fixed_cost = 20 * 24 * HOURLY_RATE
# Elastic capacity: server-hours following the demand curve.
# One entry per 4-hour block, matching the chart above.
servers_per_block = [4, 4, 10, 20, 12, 6]
elastic_cost = sum(n * 4 * HOURLY_RATE for n in servers_per_block)
print(f"Fixed: ${fixed_cost:.2f} per day")
print(f"Elastic: ${elastic_cost:.2f} per day")
print(f"Saving: {100 * (1 - elastic_cost / fixed_cost):.0f}%")Running this prints a fixed cost of $48.00, an elastic cost of $22.40, and a saving of 53 percent. The numbers are invented, but the mechanism is real: you pay for the area under the demand curve, not for the peak.
Putting the characteristics together
The characteristics depend on each other. Self-service makes it possible to request capacity without delay. Network access lets you do it from anywhere. Pooling gives the provider spare capacity to hand out. Elasticity uses that spare capacity as demand changes. Measurement turns all of that into a bill and into data you can act on.
Testing a service against the definition
Use these questions to decide whether a service is really cloud:
| Question | Characteristic tested |
|---|---|
| Can I create it myself, without a ticket or sales call? | On-demand self-service |
| Can I reach it through standard network protocols? | Broad network access |
| Can I get more or less within minutes, and release it? | Rapid elasticity |
| Am I charged by measured use, and can I see the numbers? | Measured service |
A virtual server rented on a yearly contract that needs a sales call to resize fails the first, third, and fourth tests. A private virtualization cluster run by your own IT team can pass all of them. This is why the definition says nothing about who owns the hardware. Deployment models, covered in a later chapter, deal with ownership.
Common errors
- Treating elasticity and scalability as the same thing.
- Provisioning for peak load out of habit, which wastes the savings that metering offers.
- Forgetting to delete unused resources. Metered billing continues until you stop or delete them.
- Assuming unlimited capacity and never checking quotas before a big launch.
- Counting only compute in cost estimates and ignoring storage and outbound data transfer.
Exercise
A company rents a dedicated server from a hosting provider. It signs a one-year contract, and any hardware change requires a support ticket answered within two business days. The billing is a flat monthly fee. Which essential characteristics does this arrangement fail, and what would need to change for it to qualify as cloud?
Show answer
It fails on-demand self-service (changes need a ticket and human approval), rapid elasticity (capacity cannot change within minutes and is fixed by the contract), and measured service (the fee is flat, not based on metered use). It does satisfy broad network access, since it is reached over standard protocols. To qualify, the customer would need to provision and resize resources through an API or console without human help, add and release capacity quickly, and be billed for measured usage.
Exercise
Using the chart in this chapter, with a server cost of $0.10 per hour, a shop holds 20 servers all day. Another shop follows the demand curve of 4, 4, 10, 20, 12, and 6 servers across six 4-hour blocks. Calculate the daily cost of each shop and the saving as a percentage.
Show answer
The first shop pays 20 × 24 × $0.10 = $48.00. The second shop pays (4 + 4 + 10 + 20 + 12 + 6) × 4 × $0.10 = 56 × 4 × $0.10 = $22.40. The saving is (48 − 22.40) / 48 ≈ 53 percent.
Exercise
An online store adds 10 web servers during a sale, but response times stay high. Name two reasons elasticity may not have helped.
Show answer
Possible reasons include a downstream bottleneck such as a single database that cannot handle more traffic, startup time for new instances that arrived after the spike, or application state stored locally on servers so the new instances cannot share the load properly.