BolEnglishLearn · Play · Win
Login

➡️ Cloud, Scalability & Resilience · Cloud, Scaling & Resilience

➡️

Horizontal Scaling

Scaling & ResilienceIntermediateModule 10

Add more machines or service instances.

Workload can be shared across multiple instances.

💡 In practice

Run six API instances behind a load balancer.

🖼️ CONCEPT PICTURE
A picture to help remember Horizontal Scaling
Run six API instances behind a load balancer.

💡 It is like opening more checkout lanes in a shop: ten shoppers get served far faster than one lane could manage.

💡 Learn🛠️ Apply🎯 Check

💡 Why it matters

Horizontal scaling lets a system grow almost without limit by adding ordinary machines instead of one giant one. It also makes the system more resilient, because if one instance dies the others keep serving. The catch is that the application must be built to run as many copies, so no single instance holds something the others need.

🛠️ How to achieve it

1
Make instances stateless
Keep session data, files, and user state in a shared store, not on one instance's local disk, so any instance can handle any request.
2
Put a load balancer in front
Spread incoming requests across the instances and stop sending traffic to one that is unhealthy.
3
Automate adding and removing
Scale the number of instances up when traffic rises and down when it falls so you only pay for what you use.
4
Share the data layer carefully
Many app instances often still talk to one database, so plan how that shared store will keep up too.

⚠️ Signs of trouble

  • •Logging in on one instance logs you out when the next request hits another.
  • •Uploaded files live on one machine and vanish when traffic is routed elsewhere.
  • •Adding instances makes things slower because they all fight over one database.
  • •There is no load balancer, so one instance gets all the traffic.
⚠️ Common mistake: Adding instances while each one still stores session or files locally. Move shared state into a common store first, or users get random, broken behaviour.

🎯 Quick check

Score: 0/3

Three questions to test the idea.

  1. 1. What is horizontal scaling?

    Answer: Adding more machines or service instances to share the work

    Scaling out means running more instances so the workload is spread across them.

  2. 2. What must be true for instances to scale horizontally without breaking?

    Answer: They should be stateless, with shared data in a common store

    If any instance can serve any request, the load balancer can spread traffic freely.

  3. 3. Why does adding a load balancer matter when scaling out?

    Answer: It spreads requests across instances and avoids unhealthy ones

    The load balancer is the front door that distributes traffic and routes around failed instances.

🔑 Key terms

Horizontal scaling
Adding more machines or instances (scaling out).
Stateless
An instance that keeps no user state of its own, so any copy can serve any request.
Load balancer
A front door that spreads requests across instances.
Auto-scaling
Automatically adding or removing instances as demand changes.

✅ Review checklist

📊 Your progress

0%
Mark this topic learned to track it.
Saved in this browser.
🚀 Got it?
Mark it learned and move to the next topic.
Next topic →