Skip to content

[Rule] Use transactional batch for atomic multi-item operations within a partition #168

Description

@sajeetharan

Cosmos DB supports transactional batches — multiple operations on items in the same logical partition that either all succeed or all fail atomically. Developers often don't know this exists and build complex compensation logic instead.

We need a rule covering:

  • .NET: \container.CreateTransactionalBatch(partitionKey)\
  • Java: \container.executeCosmosBatch()\
  • Limitation: all items must share the same partition key
  • Max 100 operations or 2MB total per batch

Category: \sdk-\ SDK Best Practices
Impact: High
Suggested file: \skills/cosmosdb-best-practices/rules/sdk-transactional-batch.md\

References:


This is a good first issue! Follow the Contributing Guide and use the rule template to get started.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions