Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Concurrency on DocumentDB

This is a newby question on DocumentDB. We want to use DocumentDB for our application. We have multiple users changing data that is stored in a DocumentDB. How can we asure that one user does not overwrite the changes of another user?

like image 983
JVermeulen Avatar asked Jun 30 '16 12:06

JVermeulen


1 Answers

DocumentDB has optimistic concurrency and has an ETag on each document. If the ETag has changed when doing a write, the write fails (if the ETag changed, that means someone else modified the document). In this condition, you'd need to re-read and re-modify the document in question.

See the faq here for more info.

like image 138
David Makogon Avatar answered Sep 22 '22 04:09

David Makogon