Range Based Sharding
The range-based
approach involves sharding the data according to a specified range of values for an attribute. This strategy is simple to understand and implement.
Consider a database that stores customer information, along with the number of products that they purchased from the store. Suppose we define 2 ranges. The first is from 1-25 and the second is 25-50 for the number of products purchased. This will result in the creation of 2 shards. The data will be divided according to the value of the quantity into their respective tables.
