Suki: Choreographed Distributed Dataflow in Rust

Shadaj Laddad, Alvin Cheung, Joseph M. HellersteinarXiv 2024 · DOI

Introduction

The development of distributed systems is often hampered by a fundamental tension between high-level abstractions and low-level operational control. While frameworks like Apache Flink offer automated data placement and fault tolerance, they often lack the granularity required for implementing custom protocols like Paxos. Conversely, actor-based models provide fine-grained control but result in fragmented logic that is difficult to reason about globally. Suki addresses these challenges by introducing a choreographic programming model embedded in Rust, enabling developers to define distributed logic as a single, global dataflow while maintaining explicit control over execution.

Methodology: Staged Choreography

Suki’s core innovation lies in its use of staged programming via the q! macro. This approach separates the compilation process into two distinct stages:

  1. Global Graph Generation: The program is initially executed on the developer's machine to produce a comprehensive global dataflow graph.
  2. Location-Based Slicing: Suki "slices" this global graph according to specified locations, generating optimized, standalone Rust source code for each node in the system.

By generating standard Rust code, Suki achieves zero-overhead compilation, allowing the final binaries to leverage LLVM-level optimizations such as autovectorization. The API introduces Locations and Clusters as first-class citizens, allowing developers to explicitly place streams and operators.

Type-Safe Infrastructure and Deployment

To bridge the "deployment gap"—the frequent disconnect between application logic and infrastructure configuration—Suki integrates cloud specifications into its type system. Developers must provide a Specification (e.g., GCP machine types and regions) to instantiate a Location. This integration allows the Rust compiler to verify infrastructure requirements at compile-time and enables Suki to automatically generate consistent Terraform configurations, significantly reducing runtime configuration errors.

Evaluation and Results

The effectiveness of Suki was demonstrated through the implementation of complex distributed protocols, including Paxos and CRDT Gossip. Evaluation of the Paxos implementation showed performance exceeding 50 kops/s, proving that Suki’s high-level abstractions do not come at the cost of throughput. The language's functional-style API, featuring primitives like cross_product and send_bincode, successfully expressed intricate communication patterns like many-to-many shuffles with minimal code.

Discussion and Future Work

While Suki provides a powerful framework for distributed dataflow, it currently faces limitations regarding static typing, which complicates the development of dynamic interpreters. Future research directions include the implementation of a global optimizer using e-graphs to automate graph rewrites for latency reduction. Furthermore, the authors plan to explore dynamic re-optimization, allowing the system to adapt its topology in real-time based on network conditions.

Conclusion

Suki demonstrates that choreographic programming can provide a unified, "single-page" view of distributed systems without sacrificing performance or control. By leveraging Rust's type system and staged programming, Suki offers a path toward more reliable and efficient distributed application development.

Summary updated

BibTeX
@misc{laddad2024suki,
  author = {Shadaj Laddad and Alvin Cheung and Joseph M. Hellerstein},
  title = {{Suki: Choreographed Distributed Dataflow in Rust}},
  year = {2024},
  eprint = {2406.14733},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.14733},
}
Figure