Horizontal vs. vertical scaling

When we talk about scaling a server, we often refer to two things:

  1. Scaling up (vertical scaling)
  2. Scaling horizontally

Scaling up means adding more compute resources to your server. If your server had 16 GM RAM, scaling up by 16 GB would increase it to 32 GB.

Scaling horizontally means adding more servers to your environment. If you initially worked with 16 GB RAM servers and would like to get to 64, you could add three more 16 GB servers.

Which to choose and when?

Vertical scaling

Choose vertical scaling if your load increases or is expected to increase by a fixed/fairly-constant amount.

Due to limitations on hardware upgrades, there are limits to how much computing power can be added to one machine. So, vertical scaling isn’t always possible – that’s where horizontal comes in.

Horizontal scaling

Horizontal scaling offers you the opportunity to add unlimited power to your server stack if resources are unlimited. Use horizontal scaling if your app needs more uptime guarantee or the load it receives exponentially increases or is expected to increase.

Not handling scaling yourself

If you don’t want to handle scaling, your best option is a serverless function.

Serverless functions abstract scaling so that you can only focus on your app. The best feature of serverless functions is that you only pay for what you use.

Free Resources

Attributions:
  1. undefined by undefined
Copyright ©2024 Educative, Inc. All rights reserved