documentdb-sharding
Horizontal sharding (partitioning) for Azure DocumentDB collections — when to shard vs stay single-shard, how to pick a shard key for read-heavy vs…
Skill by AzureOfficial
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/azure-documentdb-sharding
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: cloud, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/documentdb-sharding
What's inside
- Skill name
documentdb-sharding- Description
- Horizontal sharding (partitioning) for Azure DocumentDB collections — when to shard vs stay single-shard, how to pick a shard key for read-heavy vs write-heavy workloads, the logical/physical shard mental model, scaling out vs scaling up, hot-partition diagnosis, and the `sh.shardCollection` / `sh.reshardCollection` commands. Use when deciding whether to shard a collection, choosing or changing a shard key, sizing a cluster, or troubleshooting uneven storage / throughput across physical shards.
- License
- MIT
- Instructions
- 37 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- name: "documentdb-sharding" does not match folder "sharding"
Files (8)
- SKILL.md
- sharding-hot-partition-diagnosis.md
- sharding-how-to-commands.md
- sharding-logical-shard-size-budget.md
- sharding-logical-vs-physical.md
- sharding-scaling-out-vs-up.md
- sharding-shard-key-selection.md
- sharding-when-to-shard.md
SKILL.md (first lines)
# Sharding — Azure DocumentDB
Azure DocumentDB shards collections **horizontally** by hashing a shard key from each document and bucketing documents into **logical shards**, which the service then maps onto **physical shards** (the actual nodes that store data and serve traffic). The service hides the placement: you pick a shard key, the service handles the hash range and rebalancing.
The decisions that *you* own:
1. **Whether to shard at all.** Sharding is not the default and is not always the right answer — single-shard clusters scale up vertically and avoid the cross-shard tax.
2. **What to shard on.** The shard key is the single biggest determinant of long-term performance. It can be changed later (`sh.reshardCollection`), but only at significant cost once the collection is large.
3. **How big each physical shard should be.** The cluster tier and storage SKU set the CPU / memory / IOPS budget per physical shard, and that's what your shard key needs to fit inside.
## Rules
- [sharding-when-to-shard](sharding-when-to-shard.md) — Default to single-shard. Shard only when a collection's storage or transaction volume can exceed one physical shard's budget (e.g., > 32 TB on the largest storage SKU). Sharded and unsharded collections can coexist.
- [sharding-shard-key-selection](sharding-shard-key-selection.md) — Read-heavy → pick the most frequent query filter to localize to one physical shard. Write-heavy → pick the highest-cardinality, evenly-distributed field. Avoid hot keys (monotonic IDs, timestamps, tenant IDs with skew).
- [sharding-logical-vs-physical](sharding-logical-vs-physical.md) — Mental model: logical shards are unbounded in count and size; physical shards are bounded by the cluster's compute/storage budget. Multiple logical shards map to one physical shard, never the reverse. Cross-shard transactions are supported but not free.
- [sharding-scaling-out-vs-up](sharding-scaling-out-vs-up.md) — Scale up (bigger tier / storage SKU) grows per-shard capacity without rebalancing; scale out (more physical shards) rebalances logical shards across the new layout. Read-heavy benefits from a bigger tier; write-heavy benefits from more shards or a bigger storage SKU.
- [sharding-hot-partition-diagnosis](sharding-hot-partition-diagnosis.md) — Symptoms (uneven CPU / IOPS / storage across shards) and remediation: reshard, change the key, or add a secondary high-cardinality field.
- [sharding-how-to-commands](sharding-how-to-commands.md) — `sh.shardCollection` / `db.adminCommand({ shardCollection: "db.collection", key: {...} })`, `sh.reshardCollection`, and the requirement to create an explicit index on the shard key (with `enableLargeIndexKeys: true`).
- [sharding-logical-shard-size-budget](sharding-logical-shard-size-budget.md) — Keep individual logical shards **below 4 TB** for best performance, even though the service imposes no hard cap.
## Quick decision flow
```
collection's expected size or throughput ≤ one physical shard's budget?
├─ yes → leave unsharded. Scale up if needed.
└─ no → shard.
├─ read-heavy? → key = most frequent query filter
└─ write-heavy? → key = highest-cardinality, evenly distributed field
```
## References
- [Sharding for horizontal scalability in Azure DocumentDB](https://learn.microsoft.com/azure/documentdb/partitioning)
- [Compute and storage in Azure DocumentDB](https://learn.microsoft.com/azure/documentdb/compute-storage)
- Related: `indexing/` (index on the shard key), `query-optimization/` (single-shard vs scatter-gather queries), `high-availability/` (replica sets within each physical shard)From Azure/documentdb-agent-kit, MIT.
More from Azure/documentdb-agent-kit
- 0.670score
documentdb-query-optimizer
AzureOfficial
Help with DocumentDB/MongoDB query optimization and indexing for Azure DocumentDB.
SkillBFreshness: B★ 6Claude Code +9 - 0.660score
documentdb-data-modeling
AzureOfficial
Data modeling patterns for Azure DocumentDB — embed vs reference, 16 MB document limit, denormalization for read-heavy workloads, schema versioning.
SkillBFreshness: B★ 6Claude Code +9 - 0.608score
documentdb-azure-deployment
AzureOfficial
Deploy an Azure DocumentDB cluster (`Microsoft.DocumentDB/mongoClusters`) end-to-end — Bicep (primary), Azure CLI one-shot, Terraform, or portal.
SkillCFreshness: C★ 6Claude Code +9 - 0.607score
documentdb-high-availability
AzureOfficial
High availability, business-continuity, and disaster-recovery best practices for Azure DocumentDB — enabling in-region HA with availability zones (99.99%…
SkillCFreshness: C★ 6Claude Code +9 - 0.607score
documentdb-indexing
AzureOfficial
Index-type selection and shape guidance for Azure DocumentDB — when to use single-field, compound (ESR), multikey, wildcard, hashed, 2dsphere, TTL, and vector…
SkillCFreshness: C★ 6Claude Code +9 - 0.607score
documentdb-mcp-setup
AzureOfficial
Guide users through installing and configuring the DocumentDB MCP server for Azure DocumentDB.
SkillCFreshness: C★ 6Claude Code +9 - 0.607score
documentdb-vector-search
AzureOfficial
Vector search best practices for Azure DocumentDB using `cosmosSearch` — choosing between DiskANN / HNSW / IVF, creating indexes, tuning `lBuild` / `lSearch`…
SkillCFreshness: C★ 6Claude Code +9 - 0.607score
documentdb-connection
AzureOfficial
Optimize MongoDB client connection configuration (pools, timeouts, patterns) for Azure DocumentDB.
SkillCFreshness: C★ 6Claude Code +9 - 0.607score
documentdb-full-text-search
AzureOfficial
Full-text search best practices for Azure DocumentDB using the `createSearchIndexes` command and `$search` aggregation stage — BM25 keyword scoring, fuzzy…
SkillCFreshness: C★ 6Claude Code +9 - 0.607score
documentdb-natural-language-querying
AzureOfficial
Generate read-only DocumentDB/MongoDB queries (find) or aggregation pipelines using natural language, with collection schema context and sample documents.
SkillCFreshness: C★ 6Claude Code +9 - 0.607score
documentdb-storage
AzureOfficial
Storage configuration guidance for Azure DocumentDB — when and how to use Premium SSD v2 high-performance storage, IOPS/bandwidth caps that are gated by…
SkillCFreshness: C★ 6Claude Code +9 - 0.601score
documentdb-query-optimization
AzureOfficial
Query and aggregation-pipeline optimization rules for Azure DocumentDB — using `explain("executionStats")` to verify index usage and avoid `COLLSCAN`.
SkillCFreshness: C★ 6Claude Code +9
Signals
- Stars
- 6
- Forks
- 12
- Open issues
- 5
- Last commit (this folder)
- May 12, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/Azure/documentdb-agent-kit
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Azure
- 0.670score
documentdb-query-optimizer
AzureOfficial
Help with DocumentDB/MongoDB query optimization and indexing for Azure DocumentDB.
SkillBFreshness: B★ 6Claude Code +9 - 0.660score
documentdb-data-modeling
AzureOfficial
Data modeling patterns for Azure DocumentDB — embed vs reference, 16 MB document limit, denormalization for read-heavy workloads, schema versioning.
SkillBFreshness: B★ 6Claude Code +9 - 0.608score
documentdb-azure-deployment
AzureOfficial
Deploy an Azure DocumentDB cluster (`Microsoft.DocumentDB/mongoClusters`) end-to-end — Bicep (primary), Azure CLI one-shot, Terraform, or portal.
SkillCFreshness: C★ 6Claude Code +9 - 0.607score
documentdb-connection
AzureOfficial
Optimize MongoDB client connection configuration (pools, timeouts, patterns) for Azure DocumentDB.
SkillCFreshness: C★ 6Claude Code +9 - 0.607score
documentdb-full-text-search
AzureOfficial
Full-text search best practices for Azure DocumentDB using the `createSearchIndexes` command and `$search` aggregation stage — BM25 keyword scoring, fuzzy…
SkillCFreshness: C★ 6Claude Code +9 - 0.607score
documentdb-high-availability
AzureOfficial
High availability, business-continuity, and disaster-recovery best practices for Azure DocumentDB — enabling in-region HA with availability zones (99.99%…
SkillCFreshness: C★ 6Claude Code +9
Cite this page
documentdb-sharding skill. Agent Mart. https://agentmart.dev/skills/azure-documentdb-sharding (last updated 2026-10-24)