| name | cosmosdb-best-practices |
| description |
╔═══════════════════════════════════════════════════════════════════════════════╗
║ ║
║ █████╗ ███████╗██╗ ██╗██████╗ ███████╗ ║
║ ██╔══██╗╚══███╔╝██║ ██║██╔══██╗██╔════╝ ║
║ ███████║ ███╔╝ ██║ ██║██████╔╝█████╗ ║
║ ██╔══██║ ███╔╝ ██║ ██║██╔══██╗██╔══╝ ║
║ ██║ ██║███████╗╚██████╔╝██║ ██║███████╗ ║
║ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ║
║ ║
║ ██████╗ ██████╗ ███████╗███╗ ███╗ ██████╗ ███████╗ ██████╗ ██████╗ ║
║ ██╔════╝██╔═══██╗██╔════╝████╗ ████║██╔═══██╗██╔════╝ ██╔══██╗██╔══██╗ ║
║ ██║ ██║ ██║███████╗██╔████╔██║██║ ██║███████╗ ██║ ██║██████╔╝ ║
║ ██║ ██║ ██║╚════██║██║╚██╔╝██║██║ ██║╚════██║ ██║ ██║██╔══██╗ ║
║ ╚██████╗╚██████╔╝███████║██║ ╚═╝ ██║╚██████╔╝███████║ ██████╔╝██████╔╝ ║
║ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝ ║
║ ║
║ ╔═══════════════════════════╗ ║
║ ║ 🚀 AGENT KIT 🚀 ║ ║
║ ╚═══════════════════════════╝ ║
║ ║
╚═══════════════════════════════════════════════════════════════════════════════╝
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.
|
| license | MIT |
| metadata | {"author":"cosmosdb-agent-kit","version":"1.0.0"} |
Azure Cosmos DB Best Practices
Comprehensive performance optimization guide for Azure Cosmos DB applications, containing 45+ rules across 8 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
- Reviewing code for performance issues
- Configuring throughput and scaling
- Building globally distributed applications
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|
| 1 | Data Modeling | CRITICAL | model- |
| 2 | Partition Key Design | CRITICAL | partition- |
| 3 | Query Optimization | HIGH | query- |
| 4 | SDK Best Practices | HIGH | sdk- |
| 5 | Indexing Strategies | MEDIUM-HIGH | index- |
| 6 | Throughput & Scaling | MEDIUM | throughput- |
| 7 | Global Distribution | MEDIUM | global- |
| 8 | Monitoring & Diagnostics | LOW-MEDIUM | monitoring- |
Quick Reference
1. Data Modeling (CRITICAL)
model-embed-related - Embed related data retrieved together
model-reference-large - Reference data when items get too large
model-avoid-2mb-limit - Keep items well under 2MB limit
model-denormalize-reads - Denormalize for read-heavy workloads
model-schema-versioning - Version your document schemas
model-type-discriminator - Use type discriminators for polymorphic data
2. Partition Key Design (CRITICAL)