liveBook · Manning

Horizontal scaling

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

Horizontal scaling is increasing or decreasing system capacity by adding or removing equivalent computing instances.

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

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Defines scaling through instance counts and database nodes, then outlines architectural requirements and capacity modes without providing configuration commands.
Examples
Illustrates spiky demand with web-application error tracking and a business-hours batch job that briefly raises database throughput.
What it assumes
Identifies stateless EC2 instances and a load balancer or queue as requirements before an application can scale horizontally.
What you can do after
Evaluate/understand it by identifying prerequisites for a dynamic EC2 pool and comparing DynamoDB capacity modes against demand.
How it connects
Connects stateless servers, load balancers, queues, shared storage, DynamoDB capacity modes, and vertical scaling.

Also explained in

Compare how 13 books explain horizontal scaling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.