DocumentDB的会话保证 [英] Session Guarantee on DocumentDB

查看:64
本文介绍了DocumentDB的会话保证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试了解使用会话一致性时DocumentDB提供的确切保证.

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

是否可能发生以下情况(假设a,b,c,d是同一文档的所有值)

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

会议1 W(a)W(b)

Session 1 W(a) W(b)

会议2 .................. W(c)W(d)

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

会议3 ................................. R(b)R(c)

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

会议4 ................................ R(c)R(b)

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

换句话说,跨会话的写是否有序(在这种情况下,b发生在c之前,或者c发生在b之前,因此C3或C4之一将违反单调读取)?

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)?

将以什么顺序应用更新a,b,c,d(假设它们都是通过会话一致性完成的)?

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

推荐答案

会话一致性为用户提供了以下保证.

Session Consistency provides following guarantees to user.

1)读取自己的写入-在会话内部执行的任何写入都将立即在会话内部可见.

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

2)单调读取-在会话中看到的任何读取都不会在会话中消退.

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

假设A,B,C,D是同一文档的递增版本.

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

C,B不是单调递增的历史,将违反会话保证.

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

注意:这里的假设是Session(4)的读取请求是按顺序发出的.即,在第一次读取完成后发出第二次读取.

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.

这篇关于DocumentDB的会话保证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆