Skip to main content
QUICK REVIEW

[Paper Review] Just-Right Consistency: reconciling availability and safety

Marc Shapiro, Annette Bieniusa|arXiv (Cornell University)|Jan 19, 2018
Distributed systems and fault toleranceComputer Science22 references6 citations
TL;DR

This paper proposes Just-Right Consistency, a principled approach to designing distributed applications that balance availability and safety by applying fine-grained consistency based on application invariants. It leverages CRDTs for AP-compatible invariants, Transactional Causal Consistency as the default model, and introduces a Bounded Counter data type and static analysis (CISE) to verify and enforce CAP-sensitive invariants, enabling industrial-scale, correctness-preserving systems in geo-distributed environments.

ABSTRACT

By the CAP Theorem, a distributed data storage system can ensure either Consistency under Partition (CP) or Availability under Partition (AP), but not both. This has led to a split between CP databases, in which updates are synchronous, and AP databases, where they are asynchronous. However, there is no inherent reason to treat all updates identically: simply, the system should be as available as possible, and synchronised just enough for the application to be correct. We offer a principled Just-Right Consistency approach to designing such applications, reconciling correctness with availability and performance, based on the following insights:(i) The Conflict-Free Replicated Data Type (CRDTs) data model supports asynchronous updates in an intuitive and principled way.(ii) Invariants involving joint or mutually-ordered updates are compatible with AP and can be guaranteed by Transactional Causal Consistency, the strongest consistency model that does not compromise availability. Regarding the remaining, "CAP-sensitive" invariants:(iii) For the common pattern of Bounded Counters, we provide encapsulated data type that is proven correct and is efficient; (iv) in the general case, static analysis can identify when synchronisation is not necessary for correctness.Our Antidote cloud database system supports CRDTs, Transactional Causal Consistency and the Bounded Counter data type. Support tools help design applications by static analysis and proof of CAP-sensitive invariants. This system supports industrial-grade applications and has been tested experimentally with hundreds of servers across several geo-distributed data centres.

Motivation & Objective

  • To address the CAP theorem's trade-off between consistency and availability by tailoring consistency to application-specific invariants rather than enforcing monolithic models.
  • To identify and formalize invariant patterns that are compatible with Availability under Partition (AP), such as those supported by CRDTs and Transactional Causal Consistency.
  • To provide a pre-packaged solution for common CAP-sensitive patterns, like bounded counters, that encapsulate necessary synchronization.
  • To develop a static analysis tool (CISE) that verifies whether application invariants remain valid under AP semantics, reducing the need for global synchronization.

Proposed method

  • Uses Conflict-Free Replicated Data Types (CRDTs) as the foundational data model to enable intuitive, convergent, and asynchronous updates across replicas.
  • Employs Transactional Causal Consistency (TCC) as the strongest consistency model that preserves availability, ensuring causally ordered updates are visible in a consistent order.
  • Introduces the Bounded Counter data type as a safe, encapsulated CRDT that guarantees correctness under AP by synchronizing only when necessary.
  • Employs static analysis via the CISE tool to verify three conditions: individual operation correctness, convergence of concurrent operations, and precondition stability under concurrency.
  • Supports hybrid consistency by allowing selective CP-mode transactions only where required by CAP-sensitive invariants, minimizing performance cost.
  • Integrates all components into the Antidote database system, which natively supports CRDTs, TCC, Bounded Counters, and CISE verification.

Experimental results

Research questions

  • RQ1Can application-level invariants be preserved in an AP system without sacrificing availability or correctness?
  • RQ2Which invariant patterns are inherently compatible with Availability under Partition, and how can they be guaranteed without global synchronization?
  • RQ3How can a common, CAP-sensitive pattern like bounded counters be encapsulated to ensure correctness while minimizing synchronization overhead?
  • RQ4Can static analysis be used to formally verify whether an application’s invariants remain valid under AP semantics, and if not, which operations require synchronization?
  • RQ5To what extent can a database system support a principled, application-aware consistency model that avoids the CP vs. AP dichotomy?

Key findings

  • The CISE static analysis tool successfully identifies when precondition checks are not stable under concurrent updates, as demonstrated in the FMKe medication delivery use case, where two concurrent process-prescription operations violated invariant safety.
  • After adding synchronization to the conflicting process-prescription operations, CISE verified the invariant was preserved, proving the method’s effectiveness in detecting and resolving correctness issues.
  • The Bounded Counter data type provides a provably correct, efficient, and encapsulated solution for bounded counting patterns, minimizing the need for application-level synchronization.
  • Antidote’s implementation of Transactional Causal Consistency (TCC) is the first full production-grade database system to support this model, enabling strong consistency guarantees without blocking availability.
  • The system has been experimentally validated across hundreds of servers in multiple geo-distributed data centers, demonstrating industrial-scale feasibility and performance.
  • The approach enables applications to achieve correctness under AP semantics by applying just enough synchronization—neither too much nor too little—based on formal verification of invariants.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.