Stored procedures are often misused as a general server-side compute layer. They should only be used when you need atomicity across multiple items in a single partition and can't use transactional batch.
We need a rule clarifying:
- Valid use case: multi-document ACID within one partition
- Anti-patterns: using sprocs for single-item CRUD, cross-partition logic, or heavy computation
- Limitations: 5-second timeout, single-partition scope, hard to debug
- Prefer SDK-side logic + transactional batch for most scenarios
Category: \pattern-\ Design Patterns
Impact: Medium
Suggested file: \skills/cosmosdb-best-practices/rules/pattern-stored-procedure-scope.md\
References:
This is a good first issue! Follow the Contributing Guide and use the rule template to get started.
Stored procedures are often misused as a general server-side compute layer. They should only be used when you need atomicity across multiple items in a single partition and can't use transactional batch.
We need a rule clarifying:
Category: \pattern-\ Design Patterns
Impact: Medium
Suggested file: \skills/cosmosdb-best-practices/rules/pattern-stored-procedure-scope.md\
References:
This is a good first issue! Follow the Contributing Guide and use the rule template to get started.