Scooby
Scooby

Reputation: 655

How to perform transactional batch operation in Azure cosmosDB

Recently Microsoft introduced Transactional Batch operation capability in Azure CosmosDB offering. In all the samples and per documentation, it seems that all operations within a batch need to be in the same partition. Wondering if there is a way to achieve Transactional Batch operations across the partition.

My use case is to create thousands of documents and the partition key is the document id. In each operation, I create 2 documents (with the same id) that are in the same partition and I need to do them as part of the transaction. I need to batch thousands of such operations.

Upvotes: 2

Views: 1211

Answers (1)

Matias Quaranta
Matias Quaranta

Reputation: 15583

Currently, no, there is no way to achieve transactions across distributed partitions.

Both Transactional Batch or Stored Procedures are executed and generate the transaction scope at the Partition Key level.

Upvotes: 5

Related Questions