Dynamic Addition/Removal of Servers
Directory-based sharding is beneficial when there is a need for dynamic addition or removal of servers. In the case of range-based sharding, there is a limitation of specifying ranges, and key-based sharding is restricted due to the hash function. The addition or removal of a server would require rehashing of hash values which could result in server downtime. Directory-based sharding provides the most flexibility in this situation as it allows to retrieve data entries by using a single key.