Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 10, 2023 07:28 am GMT

System Design : Vertical And Horizontal Scaling

To expose our code, we cannot simply give our computer to anyone. Therefore, we need to find a way to share our code securely. To run our code, we first need to create a database on our computer and also plan for contingencies in case of power loss. It's crucial to ensure that our service remains uninterrupted since many people depend on it, and we don't want to disappoint them.

To achieve this, we should consider hosting our services on the cloud.

But what distinguishes cloud computing from desktop computing? There's actually no significant difference between the two. With cloud computing, we can access a set of computers that provide computational power, just like a desktop that's located somewhere else. We can upload our code to a cloud computer via remote login, making cloud computing a viable option for running our services.



Let's focus on the business requirements.

If many people will be using your service and your code can't handle that many requests, what will be the solution? There are two approaches:

  1. Vertical Scaling: You can upgrade your existing machine to a larger one to process requests faster.
  2. Horizontal Scaling: You can add more machines and distribute requests among them.Both of these approaches are known as scalability, which is the ability to handle an increasing number of requests. By implementing these mechanisms, you can increase the scalability of your system.



Horizontal Scaling

  • [1], [2], [3], [4], [5]. (Many Different Machines)
  • Load Balancing Required
  • Resilient : Request can be redirected if system is busy.
  • Communication between servers occurs over the network, which means that it involves network calls. However, network calls are generally slower than other types of calls since they involve input/output (I/O) operations. This is because data needs to be transmitted over the network, which takes time. Such calls are also known as Remote Procedure Calls (RPC).
  • Data inconsistency can occur when multiple requests are simultaneously using the database.
  • Scales well as users increase.



Vertical Scaling

  • [ Huge Machine ]
  • No Load Balancing Required
  • Single point of failure. Because of only one machine.
  • Here we have Inter Process Communication. So faster than Horizontal Scaling.
  • Data consistent because one system where all data resides.
  • Hardware Limit.



What do you think is used in the real world?

  • The answer is that both vertical and horizontal scaling have different benefits, so we use them according to our requirements.
  • However, a hybrid solution is essentially horizontal scaling, where each machine has a larger processing capacity.
  • Initially, it's recommended to use vertical scaling, but once users trust your service, you can consider moving to horizontal scaling.

Original Link: https://dev.to/prkskrs/system-design-vertical-and-horizontal-scaling-4fde

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To