6

MongoDB 2.4 有一个新功能,我看到周围的每个人都在谈论,所以这是我的问题(对不起,如果它们很简单):

  • MongoDB 是否在不指定分片键的情况下管理它们?还是管理员选择密钥?
  • 是否存在出现 Hostspot 问题或磁盘 IO 滞后的风险,因为存在 Hash 一词,而 hash 是随机的?
4

1 回答 1

4

The idea is that you can create a hashed index on a field you want to use as the shard key that happens to give bad write distribution (for example, it's monotonically increasing and would create a hotspot on recent entries).

The hash stored in the hashed index is 64 bits of the 128 bit md5 hash. The goal is to allow sharding by the hash value of the key without the application needing to know about the hashing mechanism.

You can find more information on this here: http://docs.mongodb.org/manual/core/sharded-cluster-internals/#sharding-hashed-shard-key-internals

于 2013-06-02T19:04:50.067 回答