Verifying Transactional Consistency of MongoDB

Hongrong Ouyang, Hengfeng Wei, Yu Huang, Haixiang Li, Anqun Pan
11/29/2021
cs.DC

Official code: Tsunaou/MongoDB-SI-Checker (0 stars, Java, last commit 2023-06-28).

Abstract

MongoDB is a popular general-purpose, document-oriented, distributed NoSQL database. It supports transactions in three different deployments: single-document transactions utilizing the WiredTiger storage engine in a standalone node, multi-document transactions in a replica set which consists of a primary node and several secondary nodes, and distributed transactions in a sharded cluster which is a group of multiple replica sets, among which data is sharded.

Show full abstract

A natural and fundamental question about MongoDB transactions is: What transactional consistency guarantee do MongoDB Transactions in each deployment provide? However, it lacks both concise pseudocode of MongoDB transactions in each deployment and formal specification of the consistency guarantees which MongoDB claimed to provide. In this work, we formally specify and verify the transactional consistency protocols of MongoDB. Specifically, we provide a concise pseudocode for the transactional consistency protocols in each MongoDB deployment, namely WIREDTIGER, REPLICASET, and SHARDEDCLUSTER, based on the official documents and source code. We then prove that WIREDTIGER, REPLICASET, and SHARDEDCLUSTER satisfy different variants of snapshot isolation, namely Strong-SI, Realtime-SI, and Session-SI, respectively. We also propose and evaluate efficient white-box checking algorithms for MongoDB transaction protocols against their consistency guarantees, effectively circumventing the NP-hard obstacle in theory.

View on arXivView PDF

Code Implementations(1)

A checker for snapshot isolation of MongoDB

00Java, PythonOct 20, 20213 years ago

Similar Papers

Cite this paper

@article{ouyang2021verifying,
  title  = {Verifying Transactional Consistency of MongoDB},
  author = {Hongrong Ouyang and Hengfeng Wei and Yu Huang and Haixiang Li and Anqun Pan},
  year   = {2021},
  eprint = {2111.14946},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2111.14946}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2111.14946.svg)](https://codeofpaper.com/paper/2111.14946)

Discussion