The ability to increase capacity of the server by connecting multiple hardware or software entities so that they work as a single logical unit is called Horizontal scalability. Horizontal scalability can be achieved with the help of clustering, distributed file system, and load balancing.
- Adding more processing units to the server or database.
- Increasing the number of nodes in the cluster.
- Reduce the responsibilities of each member node by expanding the keyspace.
- Provide additional endpoints for client connections.
When servers are clustered, the original server is being scaled out horizontally. If a cluster requires more resources to improve performance and provide high availability, an administrator can scale out by adding more servers to the cluster.
How To Achieve Effective Horizontal Scaling
The first is to make your application stateless on the server-side as much as possible. Any time your application has to rely on server-side tracking of what it’s doing at a given moment, that user session is tied inextricably to that particular server.
If, on the other hand, all session-related specifics are stored browser-side, that session can be passed seamlessly across literally hundreds of servers. The ability to hand a single session (or thousands or millions of single sessions) across servers interchangeably is the very epitome of horizontal scaling.
Advantages of Horizontal Scalability
- Infinite scale: In theory, if an application can scale horizontally, it can use an infinite number of instances to allow unlimited growth and serve an infinite number of requests.
- Tool: Cloud service providers have tools so that their users can use this form of scalability from day one. You don’t need extensive knowledge of how to configure all options or how to balance traffic. Tools make it easy to scale an application.
Disadvantages of Horizontal Scalability
- Architectural design. Designing an application correctly is a challenge due to different elements that must be taken into account. Many of which are related to state preservation (such as cookies) and security management. Additionally, consistent architectural design is required to create an application that is capable of scaling 100% horizontally. Although the horizontal scale is a goal that everyone aspires to achieve, not everyone can do it.
- Databases and Persistence. An application needs a database to store information. Depending on the type of database, this may require additional architectural work to ensure the application scale, without scaling the data layer.