Day 10/100 of 100daysofcode - Scaling Systems: Vertical vs. Horizontal Scaling
Today, I deepened my understanding of system scaling, which plays a crucial role in building efficient, scalable architectures.
Vertical Scaling (Scaling Up): Involves adding more power (CPU, RAM, etc.) to an existing server. It’s simple but has limitations:
Easier to implement initially
No changes in the codebase
But it’s constrained by the hardware limit—once you’ve maxed out, that’s it!
Horizontal Scaling (Scaling Out): Involves adding more machines (servers) to distribute the load. It’s more flexible but requires more planning:
You can theoretically scale indefinitely
Better fault tolerance as the system doesn’t rely on a single machine
But requires changes in architecture and how systems handle data distribution (e.g., load balancers, sharding, etc.)
Key Learning: Starting with vertical scaling is common, but as systems grow, horizontal scaling is often the sustainable solution for long-term performance and stability.
