Horizontal scaling and vertical scaling

Task Statement 2.1: Design scalable and loosely coupled architectures.

📘AWS Certified Solutions Architect – (SAA-C03)


1. What Is Scaling?

Scaling means increasing or decreasing system resources to handle workload changes.

In AWS architecture, scaling ensures that:

  • Applications can handle more users or traffic
  • Performance remains fast and stable
  • Costs are optimized (no paying for unused resources)
  • The system remains highly available

For the SAA-C03 exam, you must understand:

  • The difference between horizontal scaling and vertical scaling
  • When to use each
  • How AWS services support scaling
  • How scaling relates to loosely coupled architectures

2. Vertical Scaling (Scaling Up or Down)

Definition

Vertical scaling means increasing or decreasing the size (power) of a single server.

This involves:

  • Adding more CPU
  • Adding more RAM
  • Increasing storage
  • Upgrading to a larger instance type

In AWS, this usually means changing the instance type of:

  • Amazon EC2

For example:

  • Changing from t3.small to t3.large
  • Moving to a memory-optimized or compute-optimized instance

How Vertical Scaling Works

You stop the instance (in most cases), change the instance type, and restart it with more resources.

This improves performance because:

  • The same server now has more processing power.

Advantages of Vertical Scaling

  • Simple to implement
  • No architecture changes required
  • Works well for:
    • Databases
    • Monolithic applications
    • Applications that cannot run on multiple servers

Limitations of Vertical Scaling

This is very important for the exam:

  1. Hardware Limit
    • There is a maximum instance size.
    • You cannot scale beyond the largest available EC2 instance.
  2. Downtime
    • Usually requires stopping the instance.
  3. Single Point of Failure
    • If the server fails, the application fails.
  4. Not Highly Available
    • It depends on one machine.

When Vertical Scaling Is Used

You typically use vertical scaling when:

  • The application runs on a single server.
  • The database needs more memory or CPU.
  • The architecture cannot easily distribute traffic.

For example:

  • Scaling a relational database instance.
  • Increasing resources for a reporting server.

3. Horizontal Scaling (Scaling Out or In)

Definition

Horizontal scaling means adding or removing multiple servers instead of increasing the size of one server.

Instead of:

  • 1 large server

You use:

  • Multiple smaller servers working together.

In AWS, horizontal scaling is commonly done using:

  • Amazon EC2 Auto Scaling
  • Elastic Load Balancing

How Horizontal Scaling Works

  1. A load balancer distributes traffic across multiple servers.
  2. When traffic increases:
    • Auto Scaling launches new EC2 instances.
  3. When traffic decreases:
    • Auto Scaling terminates extra instances.

The load balancer ensures users are automatically sent to healthy servers.


Advantages of Horizontal Scaling

This is extremely important for the exam.

1. High Availability

If one server fails:

  • Others continue working.

2. No Hardware Limit

You can keep adding more servers (within AWS service limits).

3. Fault Tolerance

Failures do not affect the entire system.

4. Better for Cloud Architecture

Cloud environments are designed for horizontal scaling.


Requirements for Horizontal Scaling

For horizontal scaling to work properly:

1. Stateless Application Design

Each server should not store user session data locally.

If sessions are stored on one server and it fails:

  • Users lose their session.

Instead, session data should be stored in:

  • Amazon ElastiCache
  • Amazon DynamoDB

This makes the system loosely coupled.


4. Horizontal vs Vertical Scaling (Exam Comparison Table)

FeatureVertical ScalingHorizontal Scaling
MethodIncrease server sizeAdd more servers
DowntimeOften requiredNot required
Fault toleranceLowHigh
Scalability limitHardware limitVirtually unlimited
Cloud best practiceNot preferredPreferred
High availabilityWeakStrong
ComplexitySimpleMore complex

5. Scaling and Loosely Coupled Architectures

The SAA-C03 exam strongly focuses on loosely coupled architectures.

What Does Loosely Coupled Mean?

Components do not depend directly on each other.

If one component fails:

  • Others continue functioning.

Horizontal scaling supports loosely coupled design.


How AWS Supports Loosely Coupled Horizontal Scaling

1. Load Balancers

  • Application Load Balancer
  • Network Load Balancer

These distribute traffic across multiple servers.


2. Auto Scaling

  • Amazon EC2 Auto Scaling

Automatically adjusts capacity.


3. Message Queues

  • Amazon SQS

Queues decouple application components.

Instead of one service directly calling another:

  • It sends a message to SQS.
  • Workers process messages independently.

This allows independent scaling of:

  • Web servers
  • Worker servers

4. Serverless Horizontal Scaling

Serverless services scale automatically:

  • AWS Lambda
  • Amazon API Gateway

They automatically scale based on requests.

No server management required.


6. Database Scaling (Exam Important)

Databases are often vertically scaled.

But horizontal scaling is also possible using:

  • Read replicas (for read scaling)
  • Sharding (data partitioning)

For example:

  • Amazon RDS supports read replicas.
  • Amazon Aurora supports multiple replicas across Availability Zones.

Important exam concept:

  • Write scaling is harder than read scaling.
  • Read replicas improve read performance only.

7. Cost Optimization and Scaling

The exam tests cost-related scaling decisions.

Horizontal scaling allows:

  • Scaling in during low traffic
  • Paying only for what you use
  • Avoiding over-provisioning

Auto Scaling helps optimize cost automatically.

Vertical scaling may cause:

  • Paying for large instance even during low usage.

8. Common Exam Scenarios

You may see questions like:

Scenario 1:

Application must handle unpredictable traffic spikes.

Correct answer:

  • Use Auto Scaling + Load Balancer (horizontal scaling)

Scenario 2:

Database performance is slow due to memory shortage.

Correct answer:

  • Upgrade instance type (vertical scaling)

Scenario 3:

Application must be highly available across multiple Availability Zones.

Correct answer:

  • Horizontal scaling across multiple AZs

9. Key Exam Points to Memorize

For SAA-C03, remember:

  • Cloud-native architectures prefer horizontal scaling
  • Horizontal scaling supports:
    • High availability
    • Fault tolerance
    • Elasticity
  • Vertical scaling has limits
  • Auto Scaling + Load Balancer = core AWS scaling pattern
  • Stateless design is required for horizontal scaling
  • Store session data externally
  • Decouple using SQS
  • Serverless automatically scales horizontally

10. Final Summary (Very Important)

Vertical Scaling

  • Scale up (bigger server)
  • Simple
  • Limited
  • Not fault tolerant
  • Used mainly for databases or legacy systems

Horizontal Scaling

  • Scale out (more servers)
  • Highly available
  • Fault tolerant
  • Cloud best practice
  • Used with:
    • Load Balancers
    • Auto Scaling
    • SQS
    • Serverless services

Final Exam Tip

If the question includes:

  • High availability
  • Fault tolerance
  • Multi-AZ
  • Elasticity
  • Handling traffic spikes

👉 The correct architecture almost always involves horizontal scaling.

If the question focuses on:

  • Increasing memory or CPU of one server
  • Database instance performance

👉 The answer is usually vertical scaling.

Buy Me a Coffee