Skill 7.1.3

Apply elasticity with autoscaling, serverless and spot capacity

Key Concepts

Autoscaling adds and removes capacity based on demand signals such as CPU, queue depth or request rate, so the workload runs on what it needs at each moment rather than on capacity sized for the peak. Scheduled scaling handles predictable patterns, such as business hours. Serverless services charge per request or per unit of execution time and scale to zero, which suits spiky and low-volume workloads; at high, steady volume, provisioned capacity can be cheaper.

Spot capacity (AWS Spot Instances, Azure Spot Virtual Machines, Google Cloud Spot VMs) sells spare capacity at deep discounts, but the provider can reclaim it with short notice: about two minutes on AWS and about 30 seconds on Azure and Google Cloud. It suits fault-tolerant, stateless or checkpointed work such as batch processing, CI builds, rendering and some training jobs.

Spot works best when a workload can use many instance types and zones, handles interruption gracefully, and mixes spot with on-demand capacity for a guaranteed baseline.