CLOUD CONCEPT

Elasticity

Elasticity is the ability to increase and decrease computing resources to match changes in workload demand.

Cloud Concepts Hub →

What is Elasticity

Elasticity aligns available capacity with actual demand, adding resources during busy periods and releasing them when demand falls. In the cloud, automated provisioning and usage-based pricing can reduce idle capacity and avoid purchasing infrastructure for occasional peaks, while helping applications maintain performance.

Elasticity means adjusting resource capacity as demand changes, in both directions. An elastic application can acquire additional capacity during a traffic spike and release that capacity afterward. The goal is not simply to make a system larger; it is to keep capacity appropriately aligned with the work being performed. Cloud platforms make this practical by providing resources through APIs instead of requiring engineers to purchase, install, and later retire physical equipment.

Consider an online store that normally needs two application servers but requires twelve during a sale. An elastic design adds servers as demand rises and removes the additional servers when traffic returns to normal. Without elasticity, the business might keep twelve servers running continuously or accept poor performance during the sale. Releasing unnecessary resources can reduce usage charges, although retained storage, minimum capacity, and other supporting infrastructure may still incur costs.

Elasticity and scalability are related but different. Scalability describes a system's ability to handle changing workload levels by changing capacity. Elasticity emphasizes matching capacity to fluctuating demand and relinquishing resources when they are no longer needed. Horizontal scaling adds or removes instances, containers, or workers; vertical scaling changes the resources assigned to an individual component. Both can support elasticity, but vertical changes may require restarts and have tighter size limits.

Automatic scaling is a common mechanism for implementing elasticity. Policies can respond to CPU utilization, request volume, or queue backlog, while scheduled actions can prepare capacity for known events. For example, background workers might scale out when queued jobs accumulate and scale in after processing catches up. On AWS, Amazon EC2 Auto Scaling provides elasticity by adjusting the number of EC2 instances according to configured policies and capacity limits. Provisioning a fixed set of cloud instances does not automatically make an application elastic.

Application design determines whether additional resources are useful. Stateless request handlers, shared session storage, distributed work queues, and graceful shutdown procedures make it easier to add and remove workers safely. A database bottleneck or an external API limit can prevent extra application servers from improving throughput. Scaling signals should therefore reflect the actual constraint rather than relying on CPU usage alone.

Elasticity is not instantaneous or unlimited. Resource quotas, available capacity, instance startup time, application initialization, and scaling-policy settings affect response speed. Minimum capacity can protect latency during sudden bursts, while maximum capacity limits spending and resource consumption. Scale-in must allow active requests or jobs to finish, and poorly tuned policies can repeatedly add and remove resources.

Elasticity is also distinct from high availability and agility. High availability keeps a workload accessible despite failures, typically through redundancy and fault isolation. Agility is the ability to experiment and deliver changes quickly. An elastic workload can still have a single point of failure, and a highly available workload can use fixed capacity. For exam questions, associate elasticity with matching resources to changing demand, high availability with continued operation, and agility with faster experimentation and delivery.

Key aspects of Elasticity

Elasticity combines demand-aligned capacity changes, safe automation, and resource release to balance performance and cost within operational limits.

Capacity follows demand

Increase resources when workloads grow and release them when demand falls. Both expansion and contraction are central to elasticity.

Automated resource adjustment

Use demand-based policies or scheduled actions to adjust capacity without repeated manual intervention. Choose metrics that reflect workload pressure, such as requests per target or queue backlog per worker.

Reduced idle-capacity costs

Releasing unused resources can reduce usage-based charges and the need to provision permanently for peak demand. Savings depend on pricing, minimum capacity, and charges for resources that remain allocated.

Application readiness

Design components so new capacity can accept work and removed capacity can shut down safely. Externalized session state and graceful connection draining help prevent scaling events from disrupting users.

Bounded response time and capacity

Account for provisioning delays, warm-up periods, quotas, and downstream limits. Set minimum and maximum capacity deliberately rather than assuming resources appear instantly or without limits.

Separate from availability and agility

Elasticity matches resources to demand; high availability addresses continued operation through failures; agility concerns the speed of experimentation and delivery. A sound architecture may need all three, but none automatically guarantees the others.

Cloud services for Elasticity

For an elastic web application on AWS, Amazon CloudWatch supplies workload metrics, Amazon EC2 Auto Scaling adjusts instance capacity, and Elastic Load Balancing distributes requests across healthy targets. AWS Application Auto Scaling provides a similar policy-driven mechanism for supported resource dimensions, including container task counts and provisioned database throughput. AWS Lambda handles execution-capacity scaling for function-based workloads without a customer-managed server fleet. These mechanisms still require suitable application design, sensible limits, and monitoring: adding compute cannot remove every downstream bottleneck, and releasing compute does not eliminate all associated infrastructure charges.

Amazon EC2 Auto Scaling image Amazon EC2 Auto Scaling

Adjusts the number of EC2 instances in an Auto Scaling group using scaling policies or scheduled actions. Minimum, desired, and maximum capacity settings define the operating range, while instance warm-up and lifecycle handling help manage transitions.

Open Amazon EC2 Auto Scaling →
AWS Lambda image AWS Lambda

Automatically scales function execution capacity in response to incoming work, subject to concurrency quotas, scaling limits, and event-source behavior. It illustrates elasticity without requiring engineers to manage a fleet of servers.

Open AWS Lambda →
Amazon CloudWatch image Amazon CloudWatch

Provides metrics and alarms that can inform or trigger scaling actions. Monitoring workload pressure, latency, and errors helps engineers determine whether capacity changes are meeting performance goals.

Open Amazon CloudWatch →