Quick Answer
A good shard key: high cardinality (many distinct values), writes distributed across all shards (no hotspot), frequently appears in queries (query isolation to one shard), not monotonically increasing. Hash shard keys distribute writes evenly but lose range query efficiency. Compound shard keys can balance writes and query isolation. Bad key = uneven distribution = one shard gets all the load.
Answer
A good shard key must offer high cardinality, distribute writes evenly, and match query patterns to avoid hotspots.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
MongoDB interview questions and answers for beginner, junior, mid-level, senior, and expert developers. Perfect for freshers and experienced candidates.