Horizontal Scaling
Horizontal scaling refers to the process of increasing the capacity of a system by adding more machines or nodes to the existing infrastructure. This approach is also known as "scaling out." It involves distributing the workload across multiple machines, allowing for parallel execution of workloads and improved fault tolerance. Horizontal scaling is often associated with the concept of adding more endpoints for connections, which can lead to increased performance and better customer experience. However, it may require changes to the application architecture and code due to the distributed nature of the data.
In the context of databases, horizontal scaling typically involves techniques such as sharding, which partitions the data across multiple nodes, and replication, which enhances the availability and reliability of the system. These methods contribute to increasing the overall capacity and performance of the database.
One of the key distinctions between horizontal and vertical scaling is that horizontal scaling requires breaking a sequential piece of logic into smaller pieces to enable parallel execution across multiple machines. On the other hand, vertical scaling, also known as "scaling up," involves adding more power, such as CPU and RAM, to an existing machine. While vertical scaling is relatively simpler in terms of logic, it may involve modifying the existing infrastructure to handle increased demands.
In summary, horizontal scaling offers the advantage of improved performance, fault tolerance, and better customer experience through the addition of more machines to the infrastructure. However, it may necessitate changes to the application architecture and code due to the distributed nature of the data.