Home / Companies / MongoDB / Blog / Post Details
Content Deep Dive

On Selecting a Shard Key for MongoDB

Blog post from MongoDB

Post Details
Company
Date Published
Author
William Zola
Word Count
2,432
Company Posts That Month
1
Language
English
Hacker News Points
-
Post removed?
No
Summary

A good shard key for MongoDB should distribute inserts, updates, and deletes uniformly across all shards, and queries uniformly across all shards. A perfect shard key would also ensure that operations only target the shards of interest, and that read locality is maintained, but this may not be possible to achieve. Cardinality, write distribution, read distribution, read targeting, and read locality are key considerations when selecting a shard key. A good shard key should match the workload of the application, and tradeoffs must be made between these factors. The ideal approach is to carefully consider all operations, optimize the important ones, and ensure that other operations are reasonably efficient.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.