Blog

Database scaling

In the process of business development, the volume of required data and operations with them grows. At a certain point, one server can no longer cope with the load, and then database scaling is necessary. How is this process carried out?

Vertical Scaling

Vertical scaling involves increasing server capacity. The main advantage of the method is its simplicity. There is no need to rewrite code when adding capacity, and it is much easier to manage one large server than an entire system. This is also the main disadvantage – scaling the resources of one server has quite specific hardware limitations. It is also worth considering the cost of such a solution: a server with a multiple of computational resources in most cases is more expensive than several less powerful servers that give the same performance in total.

Horizontal scaling

Horizontal scaling means increasing performance by splitting data across multiple servers. This method involves increasing performance without decreasing fault tolerance. There are three main types of horizontal scaling.

Replication

This term implies copying data between servers. When using this method, there are two types of servers: master and slave. The master is used to write or change information, slaves are used to copy information from the master and read it. Most often one master and several slaves are used, as there are usually more requests for reading than requests for changing. The main advantage of replication is a large number of data copies. So, if even the master server fails, any other server can replace it. However, replication is not very convenient as a scaling mechanism. The reason for this is unsynchronization and delays in data transfer between servers. Replication is most often used as a means of providing fault tolerance in conjunction with other scaling methods.

Partitioning/Sectioning

This scaling method involves partitioning data into parts based on some feature. For example, a table can be partitioned into two based on parity. The reason for using partitioning is to improve performance. This is because the search is not performed on the whole table, but only on a part of it. Another advantage of this method is the ability to quickly delete an irrelevant table fragment.

Sharding/sharding/segmenting

Sharding is a database design principle in which parts of a table are stored separately, on different physical servers. Sharding is the most appropriate solution for large-scale operations, especially when paired with replication. But it is worth noting that it is quite difficult to organize, as inter-server communication must be taken into account.

Summary

Due to the creation of corporate high-loaded systems, where the volume of information and users grows every day, the ability to scale the system is one of the key factors in its selection. After all, if each stage of business development will be accompanied by a long and complex process of optimization of information support, it is worth thinking about the correctness of the choice of information system.

Do you have any questions?
Contact us and our managers will advise you.
Browsing the website you agree to the use of cookies