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.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "cosmosdb-best-practices" with this command: npx skills add azurecosmosdb/cosmosdb-agent-kit/azurecosmosdb-cosmosdb-agent-kit-cosmosdb-best-practices

Azure Cosmos DB Best Practices

Comprehensive performance optimization guide for Azure Cosmos DB applications, containing 75+ rules across 11 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Designing data models for Cosmos DB
  • Choosing partition keys
  • Writing or optimizing queries
  • Implementing SDK patterns
  • Using the Cosmos DB Emulator for local development
  • Inspecting or managing Cosmos DB data with developer tooling
  • Implementing vector search or RAG features on Cosmos DB
  • Reviewing code for performance issues
  • Configuring throughput and scaling
  • Building globally distributed applications

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Data ModelingCRITICALmodel-
2Partition Key DesignCRITICALpartition-
3Query OptimizationHIGHquery-
4SDK Best PracticesHIGHsdk-
5Indexing StrategiesMEDIUM-HIGHindex-
6Throughput & ScalingMEDIUMthroughput-
7Global DistributionMEDIUMglobal-
8Monitoring & DiagnosticsLOW-MEDIUMmonitoring-
9Design PatternsHIGHpattern-
10Developer ToolingMEDIUMtooling-
11Vector SearchHIGHvector-

Quick Reference

1. Data Modeling (CRITICAL)

2. Partition Key Design (CRITICAL)

3. Query Optimization (HIGH)

4. SDK Best Practices (HIGH)

5. Indexing Strategies (MEDIUM-HIGH)

6. Throughput & Scaling (MEDIUM)

7. Global Distribution (MEDIUM)

8. Monitoring & Diagnostics (LOW-MEDIUM)

9. Design Patterns (HIGH)

10. Developer Tooling (MEDIUM)

11. Vector Search (HIGH)

12. Full-Text Search (HIGH)

  • fts-enable-capability - Enable EnableNoSQLFullTextSearch capability on the account — prerequisite for all FTS functions
  • fts-full-text-policy - Define fullTextPolicy on the container with correct language code (en-US, case-sensitive)
  • fts-index-policy - Add fullTextIndexes entry in the indexing policy to build the inverted index
  • fts-contains-query - Use FullTextContains / FullTextContainsAll / FullTextContainsAny instead of CONTAINS(LOWER(...))
  • fts-score-ranking - Use ORDER BY RANK FullTextScore(path, term) for BM25 relevance ranking
  • fts-hybrid-query - Combine FTS predicates with range/equality filters; put most selective filter first

How to Use

Use the linked rule files above for detailed explanations and code examples. The links give the agent direct paths to the relevant guidance instead of relying on folder scanning or inferred filenames.

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Additional context and references

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Veracode

Veracode integration. Manage data, records, and automate workflows. Use when the user wants to interact with Veracode data.

Registry SourceRecently Updated
Coding

.Clawhub Dist

The autonomous Agentic Development Ecosystem. Propose, Build, Publish, and Compound.

Registry SourceRecently Updated
Coding

Resource Guru

Resource Guru integration. Manage Persons, Projects, Clients, Bookings. Use when the user wants to interact with Resource Guru data.

Registry SourceRecently Updated
2490Profile unavailable
Coding

Pushsafer

Pushsafer integration. Manage Devices. Use when the user wants to interact with Pushsafer data.

Registry SourceRecently Updated
2010Profile unavailable