In my scenario i'm processing changes in a Cosmos Db Collection with Azure Functions using a CosmosDbTrigger.
The source Cosmos Db Collection is partitioned by Device Id. Outputs are persisted in another Cosmos Db Collection. In some cases i have to correlate multiple documents from the same device and output one single document.
So i'm wondering if i have to apply some sort of transactional logic in order to prevent race conditions when i receive 2 documents who should merge into a single one at the same time by multiple instances of my Azure Function? Or can i rely on getting a batch of changes per partition on the same function instance where i can process and correlate all the related documents in a loop?
The number of changes per partition will never exceed the default 100 items for a single batch.