Directory-Based Sharding
Directory-based
sharding utilizes a lookup table that keeps track of which shard holds what data. In other words, it specifies a one-to-one mapping of the data with the shard that it is stored in.
Consider the example below. A column from the original table is selected as shard key
(just as we did for key-based sharding). Each shard key is then given a specific shard ID
, which tells which shard has the data with its corresponding shard key
. In this way, the rows of all the rows in the original table are divided into different shards.

Let's see if you understand sharding!