Session Guarantee on DocumentDB

梦想与她 提交于 2019-12-23 05:26:16

问题


I am trying to understand the exact guarantees provided by DocumentDB when using session consistency.

Is it possible for the following to happen (lets assume a,b,c,d are all values of the same document)

Session 1 W(a) W(b)

Session 2..................W(c)W(d)

Session 3................................. R(b)R(c)

Session 4................................ R(c)R(b)

In other words, are writes across sessions ordered (in which case, either b happens before c or c happens before b, so one of C3 or C4 will violate monotonic reads)?

In what order will the updates a,b,c,d (assuming they are all made with session consistency) be applied?


回答1:


Session Consistency provides following guarantees to user.

1) Read Your Own Write- Any write performed inside the session is immediately visible inside the session.

2) Monotonic Read - Any read seen inside a session will not regress within a session.

Assuming A,B,C,D are increasing version of same document.

C, B is not a monotonic increasing history and will be violation of session guarantee.

Note: The assumption here is read requests by Session(4) are issued in serial order. i.e. Second read is issued after completion of first read.



来源:https://stackoverflow.com/questions/36415310/session-guarantee-on-documentdb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!