Back to System Design Course

System Design Course

Scalability is the capability of a system, process, or a network to grow and manage increased demand. Any distributed system that can continuously evolve in order to support the growing amount of work is considered to be scalable.

A system may have to scale because of many reasons like increased data volume or increased amount of work, e.g., number of transactions. A scalable system would like to achieve this scaling without performance loss.

Generally, the performance of a system, although designed (or claimed) to be scalable, declines with the system size due to the management or environment cost. For instance, network speed may become slower because machines tend to be far apart from one another. More generally, some tasks may not be distributed, either because of their inherent atomic nature or because of some flaw in the system design. At some point, such tasks would limit the speed-up obtained by distribution. A scalable architecture avoids this situation and attempts to balance the load on all the participating nodes evenly.

Scaling of any system can be achieved by two ways.

  • Vertical Scaling

    Vertical scaling, referred to as scale up, means the process of adding more power (CPU, RAM, etc.) to your servers.

    When traffic is low, vertical scaling is a great option, and the simplicity of vertical scaling is its main advantage.

    However, vertical scaling comes with some serious drawbacks:

    1. You can add more CPU, RAM, etc. to your database server, but there are hardware limits. If you have a large user base, a single server is not enough.

    2. Greater risk of single point of failures.

    3. The overall cost of vertical scaling is high. Powerful servers are much more expensive.

  • Horizontal Scaling

    Horizontal scaling, referred to as scale-out, allows you to scale by adding more servers into your pool of resources.

    Horizontal scaling is more desirable for large scale applications due to the limitations of vertical scaling.

Differences between Horizontal and Vertical Scaling

screenshot of the app

screenshot of the app

Good examples of horizontal scaling are Cassandra and MongoDB as they both provide an easy way to scale horizontally by adding more machines to meet growing needs. Similarly, a good example of vertical scaling is MySQL as it allows for an easy way to scale vertically by switching from smaller to bigger machines. However, this process often involves downtime.