Table of Contents
Fetching ...

Stateful Entities: Object-oriented Cloud Applications as Distributed Dataflows

Kyriakos Psarakis, Wouter Zorgdrager, Marios Fragkoulis, Guido Salvaneschi, Asterios Katsifodimos

TL;DR

This work argues that exactly-once processing should be a programming model primitive for cloud applications and proposes a compiler pipeline that translates imperative, object-oriented Python programs into portable, stateful dataflow graphs. By annotating classes with @stateflow, performing static analysis, and applying continuation-passing-style function splitting, the approach yields an intermediate representation that can run on multiple runtimes (e.g., Flink Statefun, StateFlow) while preserving developer-friendly imperative semantics. A Python-based StateFlow prototype demonstrates ACID-like semantics and low-latency execution for transactional workloads, with preliminary results showing sub-100 ms latency and minimal overhead from program transformation. The work outlines open problems in transactions, analysis, and dataflow engine design, and positions dataflow graphs as a promising IR for portable, reliable cloud applications.

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.

Stateful Entities: Object-oriented Cloud Applications as Distributed Dataflows

TL;DR

This work argues that exactly-once processing should be a programming model primitive for cloud applications and proposes a compiler pipeline that translates imperative, object-oriented Python programs into portable, stateful dataflow graphs. By annotating classes with @stateflow, performing static analysis, and applying continuation-passing-style function splitting, the approach yields an intermediate representation that can run on multiple runtimes (e.g., Flink Statefun, StateFlow) while preserving developer-friendly imperative semantics. A Python-based StateFlow prototype demonstrates ACID-like semantics and low-latency execution for transactional workloads, with preliminary results showing sub-100 ms latency and minimal overhead from program transformation. The work outlines open problems in transactions, analysis, and dataflow engine design, and positions dataflow graphs as a promising IR for portable, reliable cloud applications.

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.
Paper Structure (12 sections, 4 figures)

This paper contains 12 sections, 4 figures.

Figures (4)

  • Figure 1: Two stateful entities: User and Item. The content of imperative functions is split into multiple functions that access the common state of a given entity. Those functions are then encoded into a stateful dataflow that can be executed in a distributed streaming dataflow engine. As a result, $i)$ imperative code is executed in an event-based manner without the need to block, and $ii)$ the code retains exactly-once processing guarantees without the need for programmers to write failure-handling code such as state management, call retries or idempotency.
  • Figure 2: Logical dataflow graph of five entities, focusing on the User entity found in \ref{['fig:calls']}.
  • Figure 3: Average latency at the 99th percentile, in YCSB (100 RPS) with both Zipfian and uniform key distributions.
  • Figure 4: Average and 99th percentile latency for the M workload, with increasing input throughput.