Table of Contents
Fetching ...

PRDTs: Composable Knowledge-Based Consensus Protocols with Replicated Data Types

Julian Haas, Ragnar Mogk, Annette Bieniusa, Mira Mezini

TL;DR

PRDTs present a knowledge-based paradigm for building consensus protocols as replicated data types, replacing bespoke message-passing implementations with modular, composable components defined over join-semilattices. By modeling knowledge as a $($Knowledge Lattice$)$ merged via $up$ and mapping to an $($Agreement Lattice$)$ through a monotone $d:S\to T$, PRDTs ensure eventual convergence and safety via threshold-enabled actions and decisions. The framework enables Paxos-like protocols to be constructed from reusable building blocks (voting, leader election, proposals) and extended to multi-shot and reconfigurable variants through algebraic composition (EpochPaxos, SequencePaxos, GenPaxos, MultiPaxos, ReconfigurablePaxos). An empirical evaluation on a PRDT-based key-value store shows competitive performance with etcd in both local and geo-distributed setups, suggesting that the abstraction does not incur prohibitive overhead and offers practical benefits for protocol customization and reasoning. Overall, PRDTs provide a scalable, flexible path toward application-specific consensus with formal reasoning advantages and a clear modular design for future optimizations and mixed-consistency scenarios.

Abstract

Consensus protocols are fundamental in distributed systems as they enable software with strong consistency properties. However, designing optimized protocols for specific use-cases under certain system assumptions is typically a laborious and error-prone process requiring expert knowledge. While most recent optimized protocols are variations of well-known algorithms like Paxos or Raft, they often necessitate complete re-implementations, potentially introducing new bugs and complicating the application of existing verification results. This approach stands in the way of application-specific consistency protocols that can easily be amended or swapped out, depending on the given application and deployment scenario. We propose Protocol Replicated Data Types (PRDTs), a novel programming model for implementing consensus protocols using replicated data types (RDTs). Inspired by the knowledge-based view of consensus, PRDTs employ RDTs to monotonically accumulate knowledge until agreement is reached. This approach allows for implementations focusing on high-level protocol logic with minimal network environment assumptions. Moreover, by applying existing algebraic composition techniques for RDTs in the PRDT context, we enable composable protocol building-blocks for implementing complex protocols. We present a formal model of our approach, demonstrate its application in PRDT-based implementations of existing protocols, and report empirical evaluation results. Our findings indicate that the PRDT approach offers enhanced flexibility and composability in protocol design, facilitates reasoning about correctness, and does not suffer from inherent performance limitations that would prevent its use in real-world applications.

PRDTs: Composable Knowledge-Based Consensus Protocols with Replicated Data Types

TL;DR

PRDTs present a knowledge-based paradigm for building consensus protocols as replicated data types, replacing bespoke message-passing implementations with modular, composable components defined over join-semilattices. By modeling knowledge as a Knowledge Lattice merged via and mapping to an Agreement Lattice through a monotone , PRDTs ensure eventual convergence and safety via threshold-enabled actions and decisions. The framework enables Paxos-like protocols to be constructed from reusable building blocks (voting, leader election, proposals) and extended to multi-shot and reconfigurable variants through algebraic composition (EpochPaxos, SequencePaxos, GenPaxos, MultiPaxos, ReconfigurablePaxos). An empirical evaluation on a PRDT-based key-value store shows competitive performance with etcd in both local and geo-distributed setups, suggesting that the abstraction does not incur prohibitive overhead and offers practical benefits for protocol customization and reasoning. Overall, PRDTs provide a scalable, flexible path toward application-specific consensus with formal reasoning advantages and a clear modular design for future optimizations and mixed-consistency scenarios.

Abstract

Consensus protocols are fundamental in distributed systems as they enable software with strong consistency properties. However, designing optimized protocols for specific use-cases under certain system assumptions is typically a laborious and error-prone process requiring expert knowledge. While most recent optimized protocols are variations of well-known algorithms like Paxos or Raft, they often necessitate complete re-implementations, potentially introducing new bugs and complicating the application of existing verification results. This approach stands in the way of application-specific consistency protocols that can easily be amended or swapped out, depending on the given application and deployment scenario. We propose Protocol Replicated Data Types (PRDTs), a novel programming model for implementing consensus protocols using replicated data types (RDTs). Inspired by the knowledge-based view of consensus, PRDTs employ RDTs to monotonically accumulate knowledge until agreement is reached. This approach allows for implementations focusing on high-level protocol logic with minimal network environment assumptions. Moreover, by applying existing algebraic composition techniques for RDTs in the PRDT context, we enable composable protocol building-blocks for implementing complex protocols. We present a formal model of our approach, demonstrate its application in PRDT-based implementations of existing protocols, and report empirical evaluation results. Our findings indicate that the PRDT approach offers enhanced flexibility and composability in protocol design, facilitates reasoning about correctness, and does not suffer from inherent performance limitations that would prevent its use in real-world applications.

Paper Structure

This paper contains 52 sections, 1 theorem, 7 equations, 8 figures.

Key Result

proposition 1

The voting PRDT presented in fig:voting-formal is safe.

Figures (8)

  • Figure \thelstlisting: Knowledge and agreement latices for a protocol with three processes voting on a type of pet.
  • Figure \thelstlisting: Example run of the Voting protocol in different settings.
  • Figure \thelstlisting: Formal definition of the voting protocol as a PRDT.
  • Figure \thelstlisting: Comparison of latency and throughput over time between etcd and our implementation in a local setup where all nodes run on a single machine.
  • Figure \thelstlisting: Overall mean throughput of etcd and our implementation for the three workloads.
  • ...and 3 more figures

Theorems & Definitions (8)

  • definition 1: ARDT
  • definition 2: Boolean Threshold Query
  • definition 3: Protocol Action
  • definition 4: Agreement Lattice
  • definition 5: Decision Function
  • definition 6: PRDT
  • definition 7: Safety
  • proposition 1