I concern how to behave in case multi-user system facing concurrent updates. Basically we are using a stored procedure to implement our logic. I knew that there is a built-in optimistic concurrency control by ETag and using a HTTP 412
response status code to know system facing preconditional failure (we can think this as concurrent updates).
But after I read more on msdn docs, I did not see any built-in pessimistic concurrency, I noticed that there is HTTP 449
(retry with) status code, but I do not know whether it is flag to let application know there is an concurrency update?
I am talking in the context of single master - single-write. We are planning moving our booking system from on-premises to Cloud and using CosmosDB as database but in old version(on-premises) we using SQL Server with Serialize mode in stored procedure to limit inconsistent state of our data.
Please advise or give me some information to implement pessimistic concurrency in CosmosDB or basically in cloud.