Issue 19 - DepFast: Orchestrating Code of Quorum Systems
DepFast: Orchestrating Code of Quorum Systems
Another weekend, another weekend read, this time all about Python: Structured concurrency
My book Thinking in Distributed Systems is now available. 12 chapters, full of mental models, diagrams, illustrations, and examples, all about distributed systems.
In their research paper DepFast: Orchestrating Code of Quorum Systems, the authors tackle distributed consensus-with a twist. Instead of focusing on the mechanics, the authors focus on enhancing the developer experience of implementing distributed consensus.
Quorum systems are critical distributed systems and building quorum systems is hard: Quorum systems often have a complex consensus protocol. A node in these protocols has a complex state space. At each state, the node has multiple possible branches to go into based on the event and its current state.
The traditional way to code these complex state transition conditions is through an event-driven or asynchronous coding style. For each event, the developer defines an event handler, or a callback function, to drive the program to the next state.
Coding in an asynchronous style makes the code harder to read and write, and harder to debug. Since the main process of handling a request from begin to end is expressed in many (callback) functions as opposed to a single function, the developer needs to manually maintain shared control, data, and debug variables across these functions.
The authors chose to resolve the above issue by turning the asynchronous code into synchronous style, using coroutines. However, coroutine-based solutions tend to inline a single asynchronous call, e.g., inlining a single RPC callback. This is insufficient for a quorum system, which often has many concurrent callbacks and timeouts, and branches based on these concurrent event composition.
The authors present a coroutine-based distributed programming framework that promotes synchronous code style and a QuorumEvent abstraction that enables the construction of straightforward protocol descriptions, even for quorum systems with complicated timeout rules and multiple quorums.
One of the best papers I have read
Happy Reading
DepFast: Orchestrating Code of Quorum Systems
Xuhao Luo, Weihai Shen, Shuai Mu, Tianyin Xu
Quorum systems are critical distributed systems. Building correct, high-performance quorum systems is known to be hard. A major reason is that the protocols in quorum systems lead to non-deterministic state changes and complex branching conditions based on different events (e.g., timeouts). Traditionally, these systems are built with an asynchronous coding style with event-driven callbacks, but often lead to “callback hell” that makes code hard to follow and maintain. Converting to synchronous cod- ing styles (e.g., using coroutines) is challenging because of the complex branching conditions. In this paper, we present Dependably Fast (DepFast), an effective, expressive framework for developing quorum systems. DepFast provides a unique QuorumEvent abstraction to enable building quorum systems in a synchronous style.