azure - Document DB - ETag Optimistic Concurrency with Session Consistency -
if have documentdb database session consistency, guarantees there concurrent writes of same document using etags? example, , b operating in different sessions:
- read:a - etag:1
- read:b - etag:1
- write:a - etag:1 (match, etag = 2)
- write:b - etag:1 ?
the assumption write:b fails since etag 2, haven't found explicit documentation on guarantee there documentdb reads etag value on server, in, could read secondary replica etag still 1, , let write:b still go through?
this question session guarantee on documentdb discusses issue in comments, not seem come conclusion.
web documentation
from faq https://docs.microsoft.com/en-us/azure/documentdb/documentdb-faq
from example source (implies, not state, holds true @ consistency levels?) https://github.com/azure/azure-documentdb-dotnet/blob/master/samples/code-samples/documentmanagement/program.cs:
documentdb team member here. confirming larry's reply conditional writes etags enforced consistency levels. write request must include etag (if-match header in rest, requestoptions.accesscondition in .net).
Comments
Post a Comment