Horizontal scaling changes capacity by adding or removing computing instances. A database can increase read and write capacity by adding nodes; a web application can respond to changing workload by increasing or decreasing its EC2 instance count. This differs from vertical scaling, which gives one instance a faster CPU, more memory, or faster storage. section 12.11 section 17.0 section 10.6
For a changing pool of EC2 instances, prepare the application first:
- Keep instances stateless. Store shared data in a service such as RDS, DynamoDB, EFS, or S3 rather than on a disk available to only one instance. section 17.0
- Give work an entry point that can reach the changing pool: a load balancer for synchronous requests or a queue for asynchronous jobs. section 17.0
For database workloads, DynamoDB offers a managed way to accommodate large or spiky request volumes. Its on-demand mode adapts read and write capacity automatically. Provisioned mode sets capacity upfront, with optional autoscaling. Choose a mode with the traffic pattern and cost in mind; an existing MySQL application cannot simply be pointed at DynamoDB instead. section 12.0 section 12.11
A business-hours traffic spike
Suppose an application normally needs 100 reads and 10 writes per second, but a late-afternoon batch job raises that to 1,000 reads and 100 writes per second. Provisioning for the peak all day may waste capacity. In the illustrated pricing calculation, on-demand capacity costs $68.85 per month versus $93.60 for provisioned capacity; actual choices depend on the workload. section 12.11












