Scalability


How to scale your app so you can handle higher load

Vertical Scaling

Get Resources with higher processor, more RAM, disk space.

Pros:

  • Nothing changes about your infrastructure, easier to manage, and you don’t have to deal with Partition problem (see CAP Theorem) Cons:
  • servers with higher storage/processing power can be a lot more expensive
  • upper ceiling on the amount of CPU/RAM/disk space you can add in a single machine.
  • available configuration usually is limited, meaning you may need only 10-20% more resources but the next available tier are 2x more resources for 2x cost.
  • upgrade hardware components usually require a downtime
  • SPOF

Horizontal Scaling

Adding more resources/nodes to distribute the workload.

Pros:

  • “infinitely scalable” you can always add another machine
  • Fault tolerance: in case of hardware failure/downtime, redundant servers can seamlessly take over
  • on demand scalability: allow us to easily accommodate increasing load by adding more machine Cons:
  • More complex:

References

  1. https://www.youtube.com/watch?v=-W9F__D3oY4
  2. https://www.digitalocean.com/resources/articles/horizontal-scaling-vs-vertical-scaling
  3. https://www.mongodb.com/resources/basics/horizontal-vs-vertical-scaling