The causal consistency guarantee MongoDB achieves

I noticed that Si_Liu opened a topic on causal consistency of MongoDB: MongoDB may achieve STRONGER causal consistency guarantee?. This topic got a solution and was automatically closed by the Community Platform. Therefore, I open this topic to add some references:

  • The work in this paper MongoDB-CCC@JCST2022: Checking Causal Consistency of MongoDB tested MongoDB against several well-known variants of causal consistency, including CC (Causal Consistency), CM (Causal Memory), and CCv (Causal Convergence). No (real) violations were found.
  • The work in [this paper Spec@SRDS2020: A Generic Specification Framework for Weakly Consistent Replicated Data Types] introduced another causal consistency variant called CMv (Causal Memory Convergence) and proved that the causal consistency protocol of (a simplified version of) MongoDB (in the failure-free sharded cluster deployment) satisfies CMv.

Hope these are helpful.

1 Like

Thanks, Hengfeng! Both papers seem to deal with CC in the non-transactional setting; we are looking at transactional CC. I’ve also found your work on SI checking. Very interesting!

1 Like

Hi @Stennie, I noticed your “like”. Since you are part of the MongoDB team, could you please help with the following question: Does MongoDB provide transactional causal consistency?

*** Here’s sth that may be useful: ***

Transactional causal consistency is simply atomic visibility + causal consistency, where atomic visibility says all or none of a txn’s effect is visible to another txn (see the RAMP-TAO paper at VLDB’21 that layers atomic visibility atop TAO). CC is a session guarantee that had been discussed mainly in the non-txn setting. Eiger (NSDI’13) is the first paper (AFAIK) that brings CC into the txn setting. There’s a considerable amount of work going after that, and some of them are turning into industry (e.g., AntidoteDB https://www.antidotedb.eu/). TCC is probably not a term in industry at the moment, but all production transaction systems with Snapshot Isolation provided at least are expected to implement that simply because TCC is strictly weaker than SI (https://drops.dagstuhl.de/opus/volltexte/2015/5375/pdf/15.pdf). Back to MongoDB, since it supports transactions and also claims causal consistency, Im curious if it actually achieves TCC. Note that it is possible for a txn system that claims CC not to guarantee TCC if CC is not respected with the txn boundary.

*** end ***

As posted, the reason that TCC has been attractive in the research community (and some of the guys are starting up their work, e.g., AntidoteDB) is basically "the strongest consistency model that can be achieved without expensive consensus protocols ".