When designing data architectures, businesses must design their data infrastructures to accommodate increased workloads, user demands, and data volumes. This involves allocating extra resources with increased user engagement and otherwise reducing resource usage. This principle is known as scaling. There are two ways we can decide to approach scaling, these are the horizontal and the vertical scaling. In this article, we will look at these two approaches, their unique characteristics, their advantages and disadvantages, and when it is advisable to use them based on your requirements.
With vertical scaling, resource upgrade happens on a single server. The capabilities of the single server such as its CPU, RAM, storage, etc are improved to handle the increase in demand, this is in contrast to horizontal scaling where multiple servers are used and the workload is distributed across these servers. For example, I have a database that stores my time-series data and as my business grows I see an exponential increase in my data and if my database is left as it is, we won’t be able to store and process these large volumes of data without sacrificing performance. To be able to handle these volumes, I would increase the processing power and increase the storage capacity of a single node on my database. Likewise, I would upgrade my database hardware by adding more RAM, increasing my CPU cores, or opting for a faster storage system than I currently use. I could also decide to partition my database into smaller more manageable parts. We could also decide to use database indexing as it makes it easier to access frequently used data which significantly improves performance on large databases. With its advantages, there are still some limitations it poses. Let’s have a look at some advantages, disadvantages, and use cases it excels in.
Advantages of Vertical Scaling
Disadvantages of Vertical Scaling
Vertical scaling remains a viable strategy for organizations seeking immediate performance enhancements and simplicity in managing their database systems. However, as the demands on infrastructure continue to evolve, it’s essential to carefully evaluate the scalability limits and consider alternative approaches such as horizontal scaling to meet future growth requirements effectively.
With horizontal scaling, data being stored in our databases becomes exponentially large, to handle this increase efficiently, we add a new node, partition, and share the data between the old and the new. The load is distributed across multiple servers. Let’s have a look at individual approaches we could use. We could use sharding, which is a strategy that partitions a large database into distributed pieces called shards. Having these shards distributed across different nodes, our database will be able to accommodate more data and requests. Likewise, we could use a load balancer to help distribute traffic across multiple databases, which would help ensure the workload is evenly distributed across the various nodes. Let’s look at the advantages of horizontal scaling, its limitations, and use cases where it excels.
Advantages of Horizontal Scaling
Disadvantages of Horizontal Scaling
Now, that we have a solid understanding of Horizontal and Vertical scaling, its advantages, disadvantages, and use cases we will look at some factors to consider when picking a scaling technique for your project.
Speed: If speed is a major factor, you’re considering, then it is advisable to go with the vertical scaling system as it is faster when compared to horizontal scaling, since it has a single server and an interprocess communication – that is, the server communicates within itself and it is fast whereas with horizontal scaling, the network calls two or more servers which are known as the RPC and generally RPCs are slow.
Point of failure: Horizontal scaling is generally safer, as it uses more than one server so in an incidence that a server crashes, it has another one to pick up the slack. This means there is no single point of failure which makes the system resilient as opposed to a vertical scaling system that has a single server, so once the server crashes everything goes offline.
Large data inflow: If you have a large data inflow with unpredictable growth patterns, it becomes advantageous to use horizontal scaling as with vertical scaling, we would incur a larger cost, and we would get to the point where we can’t scale any further but smaller businesses can make use of vertical scaling as it is optimal for small dataflows.
Conclusion
In this article, we have been able to have a look at horizontal scaling and vertical scaling and as a business, you would know which is more suited to use. Having this background on scaling, in our next article will have a tutorial showing how we can implement scaling in our database, we will also have a use case showing implementation in a document-type database and implementation in a relational database. Till then, have fun!
NITDA IT Hub, Unilag is a platform created to drive Tech innovations by being the bridge between academia, industry, startups and investors interested in enhancing the digital economy of the nation.
Copyright © 2022 NitHub. All rights reserved.
Copyright © 2022 NitHub. All rights reserved.