➡️ Cloud, Scalability & Resilience · Cloud, Scaling & Resilience
Horizontal Scaling
Add more machines or service instances.
Workload can be shared across multiple instances.
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.
💡 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
⚠️ 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.
🎯 Quick check
Score: 0/3Three questions to test the idea.
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. 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. 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.
