CosmosDB: Bulk support (or guidance on throughput improvement via batching) #22504
Labels
Client
This issue points to a problem in the data-plane of the library.
Cosmos
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-team-attention
This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Feature Request
Bulk support doesn't exist today in the Go SDK. My understanding is that it would be complex to implement and is unlikely to be done anytime soon if at all. Still, I'm curious if the Transactional Batch support added in #17795 allows for an application developer to get at least some of the throughput benefits of bulk or if there are fundamental differences between them.
Based on this, this, and the .NET implementation, my understanding is that Bulk is essentially TransactionalBatch with the enhancements that it:
x-ms-cosmos-batch-atomic
to false,x-ms-cosmos-batch-continue-on-error
to trueSome of these are relatively easy for an application to implement, but (1) isn't possible because the Go SDK lacks any concept of physical partitions / ranges today, and
TransactionalBatch
(like all operations) accepts only a single partitionKey.So I guess my question is - is
NewTransactionalBatch(partitionKey)
at all useful for bulk operations even without knowledge of physical partitions, assuming you can fill batches per partitionKey? With sequential requests it still seems useful to batch them, but I imagine as soon as you try to parallelize the batches you're going to hit severe throttling even if you tried to implement some sort of congestion control at the partitionKey level (edit: although perhapsx-ms-documentdb-partitionkeyrangeid
response header could help).More generally, what are the recommendations for optimizing throughput given the limitations of the Go SDK?
The text was updated successfully, but these errors were encountered: