to partition your collection • Shard key must exist in every document • Shard key is immutable • Shard key values are immutable • Shard key must be indexed • Shard key is used to route requests to shards
Key Space {x: 0}! {x: 6}! {x: 7}! {x: -5}! {x: 10}! {x: -9}! 0 0 • A chunk is split once it exceeds the maximum size • There is no split point if all documents have the same shard key • Chunk split is a logical operation (no data is moved) • If split creates too large of a discrepancy of chunk count across cluster a balancing round starts
have an array value • Incompatible with tag aware sharding – Tags would be assigned the value of the hash, not the value of the underlying key • Key with poor cardinality is going to give a hash with poor cardinality – Floating point numbers are squashed. E.g. 100.4 will be hashed as 100