microsoft / Data-Appliance-GX

Sovereign Data Sharing Appliance/Connector for enterprise scenarios
MIT License
8 stars 7 forks source link

Investigate row locking mechanisms in CosmosDB #99

Closed paullatzelsperger closed 3 years ago

paullatzelsperger commented 3 years ago

Let's see if CosmosDB has anything similar to a select for update or allows locking rows in general. Following questions should be answered:

paullatzelsperger commented 3 years ago

CosmosDB itself does not support automatic row locking or a SELECT ... FOR UPDATE statement per se, so a solution was devised where the document itself has a lease property, which contains information about whether the document is locked or not. the query is then performed in a stored procedure, atomically updating the lease property.