Skip to main content
QUICK REVIEW

[论文解读] Stateful Entities: Object-oriented Cloud Applications as Distributed Dataflows

Kyriakos Psarakis, Wouter Zorgdrager|arXiv (Cornell University)|Nov 18, 2021
Distributed systems and fault tolerance被引用 4
一句话总结

该论文提出了一种编译器流水线,可将作为有状态实体建模的命令式、事务性Python程序转换为分布式有状态数据流图,从而在流式处理引擎上实现原生的精确一次处理保证。初步基准测试显示延迟低于100毫秒,使应用开发者无需关注故障管理与状态一致性问题。

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.

研究动机与目标

  • 降低云应用开发者在分布式系统相关问题(如状态管理、重试机制和幂等性)上的负担。
  • 使命令式、面向对象的云应用能够利用流式数据流引擎的精确一次处理保证。
  • 通过将高层代码编译为与执行运行时无关的可移植中间表示(IR),抽象出基础设施复杂性。
  • 证明将程序转换为数据流模型时性能开销可忽略不计,同时保持低延迟执行。
  • 为构建可在不同云提供商和执行引擎间移植的云原生应用奠定基础。

提出的方法

  • 对Python抽象语法树(AST)进行静态分析,识别有状态实体及其事务性方法。
  • 将命令式代码转换为增强的有状态数据流图IR,将方法调用建模为带有持久状态的数据流操作符。
  • 将IR编译为目标数据流引擎(如Apache Flink Stateful Functions和作者自研的StateFlow系统)。
  • 利用目标引擎的精确一次消息处理语义,消除应用逻辑中手动处理故障的需要。
  • 在Python中使用内部领域特定语言(DSL),在保持开发者熟悉度的同时支持静态分析与转换。
  • 支持在不修改应用代码的前提下透明切换执行后端。

实验结果

研究问题

  • RQ1是否能够自动将命令式、事务性的面向对象代码编译为分布式有状态数据流,同时保持语义正确性?
  • RQ2该转换流水线在真实工作负载中引入的性能开销有多大?
  • RQ3能否利用现有具备精确一次保证的流式数据流引擎,消除云应用中手动故障处理的需要?
  • RQ4可移植的中间表示如何实现跨不同云提供商和执行引擎的可移植性?
  • RQ5将通用面向对象代码编译为数据流图存在哪些实际限制和可扩展性特征?

主要发现

  • 编译器流水线成功将命令式Python代码转换为可在具备精确一次语义的流式引擎上执行的有状态数据流图。
  • 初步实验表明,事务性工作负载的延迟低于100毫秒,表明运行时开销极低。
  • 通过YCSB+T基准测试测量,转换过程引入的性能开销小于1%。
  • 该方法将应用逻辑与基础设施关注点解耦,消除了开发者实现幂等性、重试或状态回滚的需要。
  • 中间表示支持在不修改应用代码的前提下部署到多种后端(包括Apache Flink Statefun和作者的StateFlow)。
  • 该系统表明,数据流模型可作为命令式云应用的低级中间表示,而非仅作为高层编程模型。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。