Horizontal Scaling
Horizontal scaling
or sharding refers to partitioning the data from one single big table in a database, across multiple independent databases based on
a sharding or partitioning key. For example, a customer table is partitioned across multiple independent databases on
CustomerID
. Each independent database stores data for one or more customers.
Horizontal scaling can be helpful when:
The data is too big to fit in one single database.
The data is to be distributed to different locations for improved performance or for compliance. For example, European customers will get improved performance if their data is in a European data center rather than an Asian data center.
Isolating tenants or customers to a database of their own for better management and performance. If all of the customer data is in a single database and there is a blocking in the database because of a transaction made for a customer, say X, then all of the other customer queries will have to wait for the blocking...