Individual skill
cosmosdb-best-practices
Azure Cosmos DB performance optimization and best practices guidelines for NoSQL, partitioning, queries, and SDK usage. Use when writing, reviewing, or refactoring code that interacts with Azure Cosmos DB, designing data models, optimizing queries, or implementing high-performance database operations. USE FOR: Cosmos DB NoSQL, partition key design, RU optimization, point reads, cross-partition queries, SDK singleton, CosmosClient, container modeling, change feed, bulk operations, vector search, full-text search, hierarchical partition keys, global distribution, autoscale throughput, indexing policy, DO NOT USE FOR: PostgreSQL, MySQL, MongoDB (non-Azure), DynamoDB, Cassandra, Azure SQL, Cosmos DB for PostgreSQL (vCore), Cosmos DB for MongoDB vCore, Azure DocumentDB, general SQL databases, Redis, Elasticsearch.
skills/cosmosdb-best-practices/SKILL.md
Source commit 3ddc18fcd4d6fe0fae154f408395ff83c39495ee
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Network or broad shell
- Last checked
- Nov 4, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 62
- Repository last updated
- Nov 3, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- agent-skills Repository topic
- azure-cosmos-db Repository topic
- azure-cosmosdb Repository topic
- best-practices Repository topic
- mcp Repository topic
- data Derived category
- design Derived category
- operations Derived category
- writing Derived category
- devops Derived category
- data-databases Derived category
- devops-containers Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
README.mddoc · 4,923 bytesSKILL.mdcore · 21,031 bytesSKILL.mdcore · 21,031 bytesagents/openai.yamlasset · 310 bytesmetadata.jsonasset · 590 bytesrules/_sections.mddoc · 3,085 bytesrules/_template.mddoc · 1,039 bytesrules/fts-add-index.mddoc · 1,976 bytesrules/fts-define-policy.mddoc · 1,707 bytesrules/fts-enable-capability.mddoc · 1,636 bytesrules/fts-hybrid-queries.mddoc · 2,327 bytesrules/fts-keyword-matching.mddoc · 2,209 bytesrules/fts-relevance-ranking.mddoc · 1,459 bytesrules/global-conflict-resolution.mddoc · 4,087 bytesrules/global-consistency.mddoc · 3,962 bytesrules/global-failover.mddoc · 3,804 bytesrules/global-multi-region-write-antipattern.mddoc · 2,646 bytesrules/global-multi-region.mddoc · 3,313 bytesrules/global-read-regions.mddoc · 3,994 bytesrules/global-zone-redundancy.mddoc · 3,576 bytesrules/index-composite-direction.mddoc · 2,892 bytesrules/index-composite.mddoc · 11,955 bytesrules/index-exclude-unused.mddoc · 4,046 bytesrules/index-lazy-consistent.mddoc · 3,363 bytesrules/index-path-syntax.mddoc · 2,545 bytesrules/index-range-vs-hash.mddoc · 3,956 bytesrules/index-spatial.mddoc · 3,193 bytesrules/model-avoid-2mb-limit.mddoc · 2,096 bytesrules/model-denormalize-reads.mddoc · 12,537 bytesrules/model-embed-related.mddoc · 2,528 bytesrules/model-id-constraints.mddoc · 7,581 bytesrules/model-json-serialization.mddoc · 6,175 bytesrules/model-nesting-depth.mddoc · 3,421 bytesrules/model-numeric-precision.mddoc · 3,324 bytesrules/model-reference-large.mddoc · 2,313 bytesrules/model-relationship-references.mddoc · 3,664 bytesrules/model-schema-versioning.mddoc · 2,893 bytesrules/model-ttl-expiration.mddoc · 3,174 bytesrules/model-type-discriminator.mddoc · 3,583 bytesrules/model-unique-keys.mddoc · 5,450 bytesrules/monitoring-azure-monitor.mddoc · 4,531 bytesrules/monitoring-diagnostic-logs.mddoc · 5,204 bytesrules/monitoring-latency.mddoc · 4,303 bytesrules/monitoring-ru-consumption.mddoc · 7,632 bytesrules/monitoring-throttling.mddoc · 4,491 bytesrules/partition-20gb-limit.mddoc · 2,893 bytesrules/partition-avoid-hotspots.mddoc · 3,478 bytesrules/partition-hierarchical.mddoc · 5,826 bytesrules/partition-high-cardinality.mddoc · 2,234 bytesrules/partition-immutable-key.mddoc · 1,812 bytesrules/partition-key-length.mddoc · 2,892 bytesrules/partition-query-patterns.mddoc · 2,747 bytesrules/partition-rekey-migration.mddoc · 4,470 bytesrules/partition-synthetic-keys.mddoc · 3,914 bytesrules/pattern-ai-grounding-access.mddoc · 4,862 bytesrules/pattern-background-task-writes.mddoc · 2,907 bytesrules/pattern-change-feed-materialized-views.mddoc · 11,559 bytesrules/pattern-efficient-ranking.mddoc · 6,053 bytesrules/pattern-langgraph-agent-name-attribution.mddoc · 2,239 bytesrules/pattern-langgraph-agent-routing-cosmosdb.mddoc · 4,690 bytesrules/pattern-langgraph-async-cosmos-routing.mddoc · 3,286 bytesrules/pattern-langgraph-async-cosmos-writes.mddoc · 2,951 bytesrules/pattern-langgraph-chat-history-separate.mddoc · 3,431 bytesrules/pattern-langgraph-fastapi-startup.mddoc · 3,146 bytesrules/pattern-langgraph-interrupt-human.mddoc · 3,745 bytesrules/pattern-langgraph-multi-agent.mddoc · 4,332 bytesrules/pattern-langgraph-resume-checkpoint.mddoc · 3,213 bytesrules/pattern-service-layer-relationships.mddoc · 4,878 bytesrules/query-aggregate-single-pass.mddoc · 2,722 bytesrules/query-avoid-cross-partition.mddoc · 4,364 bytesrules/query-avoid-scans.mddoc · 2,569 bytesrules/query-distinct-keyword.mddoc · 2,315 bytesrules/query-latest-by-timestamp.mddoc · 2,223 bytesrules/query-olap-detection.mddoc · 5,064 bytesrules/query-order-filters.mddoc · 4,810 bytesrules/query-pagination.mddoc · 7,846 bytesrules/query-parameterize.mddoc · 3,833 bytesrules/query-point-reads.mddoc · 9,916 bytesrules/query-top-literal.mddoc · 1,928 bytesrules/query-use-projections.mddoc · 5,660 bytesrules/sdk-async-api.mddoc · 3,291 bytesrules/sdk-availability-strategy.mddoc · 5,405 bytesrules/sdk-circuit-breaker.mddoc · 8,576 bytesrules/sdk-conditional-create-etag.mddoc · 2,867 bytesrules/sdk-connection-mode.mddoc · 2,969 bytesrules/sdk-continuation-token-null-guard.mddoc · 3,308 bytesrules/sdk-diagnostics.mddoc · 6,822 bytesrules/sdk-dotnet-cosmos-package-id.mddoc · 1,844 bytesrules/sdk-dotnet-namespace-collision.mddoc · 2,865 bytesrules/sdk-emulator-ssl.mddoc · 15,631 bytesrules/sdk-etag-concurrency.mddoc · 9,779 bytesrules/sdk-excluded-regions.mddoc · 4,979 bytesrules/sdk-go-partition-key-metadata.mddoc · 3,061 bytesrules/sdk-ingestion-rate-control.mddoc · 8,892 bytesrules/sdk-java-content-response.mddoc · 8,427 bytesrules/sdk-java-cosmos-config.mddoc · 10,314 bytesrules/sdk-java-spring-boot-versions.mddoc · 5,047 bytesrules/sdk-langchain-async-checkpointer.mddoc · 2,882 bytesrules/sdk-langchain-cosmosdb-saver.mddoc · 2,612 bytesrules/sdk-langchain-js-chat-history.mddoc · 3,480 bytesrules/sdk-langchain-js-embedding-model.mddoc · 2,910 bytesrules/sdk-langchain-js-filter-injection.mddoc · 3,973 bytesrules/sdk-langchain-js-fulltext-prerequisites.mddoc · 3,840 bytesrules/sdk-langchain-js-managed-identity.mddoc · 2,787 bytesrules/sdk-langchain-js-search-types.mddoc · 2,753 bytesrules/sdk-langchain-js-semantic-cache.mddoc · 3,037 bytesrules/sdk-langchain-js-vectorstore-init.mddoc · 2,825 bytesrules/sdk-langchain-mcp-persistent-session.mddoc · 3,508 bytesrules/sdk-langchain-mcp-tool-content-format.mddoc · 1,982 bytesrules/sdk-langgraph-mcp-tool-filtering.mddoc · 2,653 bytesrules/sdk-local-dev-config.mddoc · 5,614 bytesrules/sdk-newtonsoft-dependency.mddoc · 4,486 bytesrules/sdk-patch-counter-increment.mddoc · 3,985 bytesrules/sdk-preferred-regions.mddoc · 3,229 bytesrules/sdk-python-async-deps.mddoc · 1,366 bytesrules/sdk-python-client-kwargs.mddoc · 3,494 bytesrules/sdk-request-options-per-call.mddoc · 3,982 bytesrules/sdk-retry-429.mddoc · 3,786 bytesrules/sdk-serialization-enums.mddoc · 4,180 bytesrules/sdk-singleton-client.mddoc · 6,282 bytesrules/sdk-spring-data-annotations.mddoc · 4,847 bytesrules/sdk-spring-data-repository.mddoc · 3,532 bytesrules/security-continuous-backup.mddoc · 2,304 bytesrules/security-disable-local-auth.mddoc · 2,294 bytesrules/security-managed-identity.mddoc · 3,387 bytesrules/security-network-restrict.mddoc · 2,197 bytesrules/security-private-endpoint-dns.mddoc · 9,533 bytesrules/security-rbac-least-privilege.mddoc · 3,154 bytesrules/throughput-autoscale.mddoc · 3,753 bytesrules/throughput-burst.mddoc · 2,737 bytesrules/throughput-container-vs-database.mddoc · 3,432 bytesrules/throughput-idle-container-review.mddoc · 3,202 bytesrules/throughput-right-size.mddoc · 3,139 bytesrules/throughput-serverless-migration.mddoc · 3,106 bytesrules/throughput-serverless.mddoc · 2,714 bytesrules/throughput-ttl-stale-data.mddoc · 3,040 bytesrules/tooling-cosmosdb-shell-setup.mddoc · 4,783 bytesrules/tooling-cosmosdb-shell-target.mddoc · 6,011 bytesrules/tooling-cosmosdb-shell-writes.mddoc · 8,461 bytesrules/tooling-emulator-setup.mddoc · 1,472 bytesrules/tooling-vscode-extension.mddoc · 1,559 bytesrules/vector-distance-query.mddoc · 4,892 bytesrules/vector-embedding-policy.mddoc · 3,866 bytesrules/vector-enable-feature.mddoc · 3,098 bytesrules/vector-index-type.mddoc · 6,926 bytesrules/vector-normalize-embeddings.mddoc · 8,779 bytesrules/vector-repository-pattern.mddoc · 13,226 bytes
Read excerpt
# Azure Cosmos DB Best Practices
Comprehensive performance optimization guide for Azure Cosmos DB applications, containing 100+ rules across 13 categories, prioritized by impact to guide automated refactoring and code generation.
Before answering, read the linked rule files relevant to the user's question.
The quick reference below is an index, not the full guidance: SDK APIs, limits,
configuration prerequisites, and caveats live in the rule bodies. Use the
language-specific integration rule when one exists rather than substituting a
generic pattern. Keep answers concise, but include the constraints that make the
recommendation correct for the user's scenario.
## When to Apply
Reference these guidelines when: