Sharding Rules
Plan your sharding strategies in advance. Unsharded tables are written only to a single shard. Select a shard key based on service scenarios.
Properly design shard keys to prevent a large amount of data from using the same shard key.
The sharding process consumes some resources but does not interrupt services.
- In scenarios where the data volume is large (more than one million rows) and the write/read ratio is high, sharding is recommended if the data volume increases with the service volume.
- If you shard a collection using a hashed shard key, pre-splitting the chunks of the sharded collection can help reduce the impact of automatic balancing and splitting on service running.
- If you want to perform a sort query based on the shard key and new data is evenly distributed based on the shard key, you can use ranged sharding. In other scenarios, you can use hashed sharding.
- Hashed sharding is recommended when you shard a collection.
Last Article: Indexing Rules
Next Article: Database Connection
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.