Skip to main content
QUICK REVIEW

[Paper Review] Stateful Entities: Object-oriented Cloud Applications as Distributed Dataflows

Kyriakos Psarakis, Wouter Zorgdrager|arXiv (Cornell University)|Nov 18, 2021
Distributed systems and fault tolerance4 citations
TL;DR

This paper proposes a compiler pipeline that transforms imperative, transactional Python programs—modeled as stateful entities—into distributed stateful dataflow graphs, enabling execution on streaming engines with native exactly-once processing guarantees. The approach achieves sub-100ms latency in preliminary benchmarks, abstracting away failure management and state consistency concerns from application developers.

ABSTRACT

Although the cloud has reached a state of robustness, the burden of using its resources falls on the shoulders of programmers who struggle to keep up with ever-growing cloud infrastructure services and abstractions. As a result, state management, scaling, operation, and failure management of scalable cloud applications, require disproportionately more effort than developing the applications' actual business logic. Our vision aims to raise the abstraction level for programming scalable cloud applications by compiling stateful entities -- a programming model enabling imperative transactional programs authored in Python -- into stateful streaming dataflows. We propose a compiler pipeline that analyzes the abstract syntax tree of stateful entities and transforms them into an intermediate representation based on stateful dataflow graphs. It then compiles that intermediate representation into different dataflow engines, leveraging their exactly-once message processing guarantees to prevent state or failure management primitives from "leaking" into the level of the programming model. Preliminary experiments with a proof of concept implementation show that despite program transformation and translation to dataflows, stateful entities can perform at sub-100ms latency even for transactional workloads.

Motivation & Objective

  • To reduce the burden of distributed systems concerns—such as state management, retries, and idempotency—on cloud application developers.
  • To enable imperative, object-oriented cloud applications to leverage the exactly-once processing guarantees of streaming dataflow engines.
  • To abstract away infrastructure complexity by compiling high-level code into a portable intermediate representation (IR) independent of execution runtime.
  • To demonstrate that program transformation into dataflows incurs negligible performance overhead while preserving low-latency execution.
  • To establish a foundation for building cloud-native applications that are portable across cloud providers and execution engines.

Proposed method

  • Static analysis of Python abstract syntax trees (ASTs) to identify stateful entities and their transactional methods.
  • Transformation of imperative code into an enriched stateful dataflow graph IR, modeling method calls as dataflow operators with persistent state.
  • Compilation of the IR into target dataflow engines such as Apache Flink Stateful Functions and the authors' own StateFlow system.
  • Leveraging the exactly-once message processing semantics of target engines to eliminate the need for manual failure handling in application logic.
  • Use of an internal DSL in Python to preserve developer familiarity while enabling static analysis and transformation.
  • Support for transparent switching between execution backends without modifying application code.

Experimental results

Research questions

  • RQ1Can imperative, transactional object-oriented code be automatically compiled into distributed stateful dataflows while preserving semantics?
  • RQ2To what extent does the transformation pipeline incur performance overhead in real-world workloads?
  • RQ3Can existing streaming dataflow engines with exactly-once guarantees be used to eliminate manual failure handling in cloud applications?
  • RQ4How can a portable intermediate representation enable portability across different cloud providers and execution engines?
  • RQ5What are the practical limitations and scalability characteristics of compiling general-purpose object-oriented code into dataflow graphs?

Key findings

  • The compiler pipeline successfully transforms imperative Python code into stateful dataflow graphs that can be executed on streaming engines with exactly-once semantics.
  • Preliminary experiments show sub-100ms latency for transactional workloads, indicating low runtime overhead.
  • The transformation process incurs less than 1% performance overhead, as measured by the YCSB+T benchmark.
  • The approach decouples application logic from infrastructure concerns, eliminating the need for developers to implement idempotency, retries, or state rollbacks.
  • The intermediate representation enables deployment to multiple backends—including Apache Flink Statefun and the authors' StateFlow—without modifying application code.
  • The system demonstrates that dataflow models can serve as a low-level IR for imperative cloud applications, rather than as a high-level programming model.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.