# On the Complexity of Checking Transactional Consistency

**Authors:** Ranadeep Biswas, Constantin Enea

arXiv: 1908.04509 · 2019-08-14

## TL;DR

This paper analyzes the computational complexity of verifying whether transactional database executions meet various consistency models, revealing some are polynomial-time checkable while others are NP-complete, with practical algorithms for the latter.

## Contribution

It provides a complexity classification for checking different transactional consistency models and introduces fixed-parameter algorithms for NP-complete cases, with empirical evaluation.

## Key findings

- Read committed, read atomic, and causal consistency are polynomial-time checkable.
- Prefix consistency and snapshot isolation are NP-complete to verify in general.
- Algorithms with fixed parameters perform well on real-world databases.

## Abstract

Transactions simplify concurrent programming by enabling computations on shared data that are isolated from other concurrent computations and are resilient to failures. Modern databases provide different consistency models for transactions corresponding to different tradeoffs between consistency and availability. In this work, we investigate the problem of checking whether a given execution of a transactional database adheres to some consistency model. We show that consistency models like read committed, read atomic, and causal consistency are polynomial time checkable while prefix consistency and snapshot isolation are NP-complete in general. These results complement a previous NP-completeness result concerning serializability. Moreover, in the context of NP-complete consistency models, we devise algorithms that are polynomial time assuming that certain parameters in the input executions, e.g., the number of sessions, are fixed. We evaluate the scalability of these algorithms in the context of several production databases.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1908.04509/full.md

## Figures

88 figures with captions in the complete paper: https://tomesphere.com/paper/1908.04509/full.md

## References

26 references — full list in the complete paper: https://tomesphere.com/paper/1908.04509/full.md

---
Source: https://tomesphere.com/paper/1908.04509