Is this providing read-your-own writes or something stronger?
Hi Mark,
In MongoDB v3.6, client-side session support allows MongoDB drivers to specify when subsequent operations are causally related.
A driver can create a client session which in turn will have a session ID associated with it. As long as operations use the same session ID, these operations will be guaranteed to be causally consistent with each other regardless of which node is being read/written to (and any election, failure, or events on the cluster).
As described in the MongoDB Causal Consistency documentation, within a single session this should guarantee:
Note that applications must ensure that only a single thread at a time executes operations in a client session.
In this case I don’t want my parents to see the photo, but from the “Casual Consistency” docs I am not clear whether that is prevented
Let’s modify your example slightly. First by removing shard, as a client should be connecting to a mongos in a sharded cluster deployment.
There are two operations:
Provided that:
Then, your parents will not have access to your New Year’s Eve photo.
See also Read Concern Considerations.
Regards,
Wan.