Q: What is Hashed Index? MongoDB 2.4 has a new feature that i see everyone around is talking about, so here is my question (sorry if they are simple):


*

*Does MongoDB manage them without specifying the shard key? or does the admin choose the key?

*Are there any risks of being in a Hostspot problem, or disk IO lags since there is the word Hash and hash is something random?


A: 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
