Subject: [mongodb-user] Re: MongoDB support for Monotonic
Read Consistency (MRC)



MongoDB allows you to tune the level of consistency you achieve by
controlling (a) whether you read from the primary only, or from
secondaries, and (b) when you write, how many nodes you wish to
acknowledge the write before control returns to the writing process
(this is useful for read-your-own-writes, for instance). MongoDB also
uses an in-order replication protocol such that a read from any given
node, once it succeeds (i.e. some particular write can be read from
some particular secondary), it will never not succeed when reading
from that node.

As you point out, there are some situations around failures and fail
overs in which the writes can seem to disappear. They will eventually
show up on all secondaries, but this can take some time depending on
the read and write load, network conditions, etc.

None of the 10gen drivers support detection of this sort of
"violation" of MRC. If it is critical to your application to always
have monotonic read consistency, you should read from the primary
only, as this offers the strongest consistency guarantees.

- Dan

On Apr 25, 12:15 pm, dhsieh <dhsi...@xxxxxxxxx> wrote:
> Inhttp://blog.mongodb.org/post/523516007/on-distributed-consistency-par...,
> Dwight alluded that MongoDB's default consistence model supports
> Strong Consistency, a super set of MRC. I would like to reconfirm
> through the following scenario that MongoDB does indeed support MRC:
>
> (1) There are 2 DC with DC1(1M1S), DC2(1S). There are 2 Apps with App2
> continues to run in the same session
> (2) App1 writes w1 to M in DC1
> (3) App2 in DC1 sets slaveOk() true, reads w1 from S in DC1 assuming
> w1 has been replicated from M in DC1
> (4) Assuming S in DC2 receives w1 replicated from M in DC1
> (4) App1 writes w2 to M in DC1
> (5) App2 reads w2 from S in DC1 assuming w2 has been replicated from M
> in DC1
> (6) Assuming S in DC1 failed & App2 reads w2 again to find out if
> there is a new w3. This time, App2 receives w1 from DC2 S since w2
> hasn't been replicated from M in DC1
>
> My question is that since App2 continues to run in the same session,
> will Mongo language driver detects violation of MRC and returns an
> error?

--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.



Programming list archiving by: Enterprise Git Hosting