Member-only story
What you should know about Database sharding
Bending the Clean Architecture Principles
What is Database Sharding?
Database sharding is a technique used to distribute a large, scalable database across multiple smaller databases, or shards. This allows the database to handle a higher volume of data and a higher number of concurrent users, while still maintaining good performance and high availability.
Types of Database Sharding
Database sharding involves dividing the data in the database into smaller, independent units, called shards. Each shard is stored on a separate database server, and can be accessed and updated independently of the other shards. This allows the database to distribute the workload across multiple servers, which can improve performance and scalability.
There are two main types of database sharding:
- Horizontal sharding: In this approach, the data is divided into shards based on the values of a specific column, such as the user’s ID or location. This allows the database to distribute the data evenly across the shards, and allows users to access their own data on a specific shard.
- Vertical sharding: In this approach, the data is divided into shards based on the type of data, such as…