Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 7 Next »

Problem

  • Issue related to storage (finite amount of disk storage, …).

  • Single server hosting the data store might not be able to provide the necessary computing power to support the load.

  • Performance is governed by the rate the server can receive requests and send replies (Network bandwidth).

  • If users are located in different regions, it might not be possible to store the entire data in one data store.

Solution

Three strategies are commonly used when selecting the shard key and deciding how to distribute data across shards.

  • The Lookup strategy. In this strategy the sharding logic implements a map that routes a request for data to the shard that contains that data using the shard key.

  • The Range strategy. This strategy groups related items together in the same shard, and orders them by shard key—the shard keys are sequential.

  • The Hash strategy. The purpose of this strategy is to reduce the chance of hotspots (shards that receive a disproportionate amount of load).

image-20240814-132847.png

Sharding in Practice

image-20240814-151018.png

Example of lookup shard map

SELECT ShardKey, DatabaseServer
FROM BookDataShardMap

  • No labels