NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Fault-tolerant and Transactional Stateful Serverless Workflows (extended version)

Haoran Zhang, Adney Cardoza, Peter Baile Chen, Sebastian Angel, Vincent LiuarXiv 2020

Serverless computing, or Function-as-a-Service (FaaS), has revolutionized cloud development by abstracting away infrastructure management. Developers can simply upload code and let the provider handle scaling and load balancing. However, this model traditionally mandates that functions remain stateless. When developers attempt to build complex, stateful applications—such as a travel booking system or a social media platform—a single failure can leave data in a corrupted or inconsistent state.

The Challenge of State in Serverless

In a standard serverless environment, if a function fails mid-execution while updating a database, the cloud provider typically restarts it. This can lead to "double-counting" errors or partial updates that violate application logic. While distributed systems have long used techniques like State Machine Replication (SMR) to solve this, serverless environments present unique hurdles:

  1. Stateless Routing: There is no guarantee that a retry or a follow-up message will reach the same function instance.
  2. Data Sovereignty: Different functions in a workflow may be owned by different teams and utilize disparate databases, requiring a federated approach.
  3. Atomicity Constraints: Popular serverless NoSQL databases (like DynamoDB) have strict limits on the amount of data that can be updated atomically in a single row (e.g., 400KB), making traditional comprehensive logging difficult.

Introducing Beldi

Beldi is a library and runtime system designed to bring "exactly-once" execution and ACID transactions to stateful serverless workflows. It allows developers to build reliable applications on standard providers like AWS Lambda without managing persistent infrastructure. Beldi treats serverless functions not as stateful services themselves, but as clients of highly available, fault-tolerant storage.

The Beldi architecture consists of a workflow of Stateful Serverless Functions (SSF), each with its own container and database logs, managed by the Beldi Runtime.

Core Technical Innovations

Beldi builds on the log-based fault-tolerant approach of earlier systems like Olive, but adapts it for the serverless ecosystem through several key components:

  • Linked DAAL (Distributed Atomic Affinity Logging): To circumvent the row-size limits of NoSQL databases, Beldi introduces a linked-list data structure for logs. It collocates application data with operation logs across multiple database rows, allowing for atomic updates even as logs grow.
  • Intent Collector (IC): This background serverless function periodically scans an "intent table." If it detects a function that has crashed or stalled, it triggers a restart. Because every operation is logged, the restarted function can resume exactly where it left off.
  • Decentralized Transactions: Beldi implements a variant of Two-Phase Commit (2PC) with "wait-die" deadlock prevention. It specifically targets opacity—an isolation level ensuring that even transactions destined to abort always see a consistent view of the world, preventing infinite loops in serverless workflows.
Linked DAAL structure: Beldi uses a linked-list approach to store logs across multiple database rows to handle size constraints.

Evaluation and Performance

The authors evaluated Beldi by porting three complex microservice benchmarks from the DeathStarBench suite: a Movie Review Service (13 functions), a Travel Reservation System (10 functions), and a Social Media Site (13 functions). The system was tested on AWS Lambda and DynamoDB, scaling up to 1,000 concurrent instances.

Key Results

  • Overhead: Providing strong guarantees comes with a performance cost. Beldi’s median request completion time is approximately 2.4–3.3x higher than a baseline with no fault tolerance. However, at high loads (99th percentile), the tail latency is only 1.2–1.8x higher, indicating the system handles congestion effectively.
  • Scalability: The system successfully saturated at approximately 800 requests per second, a limit primarily imposed by AWS’s default concurrent Lambda limits rather than Beldi’s own architecture.
  • Affordability: The cost of additional database writes and scans is positioned as a reasonable trade-off for the significant reduction in developer effort required to handle manual fault recovery and consistency logic.

Conclusion

Beldi demonstrates that it is possible to achieve high-level transactional guarantees in a serverless environment by shifting the responsibility of state management to a specialized library and runtime. While it requires underlying databases to support strong consistency, it provides a powerful framework for developers to build complex, federated, and reliable microservices without the operational burden of managing virtual machines or global coordinators.

Summary updated

BibTeX
@misc{zhang2020fault,
  author = {Haoran Zhang and Adney Cardoza and Peter Baile Chen and Sebastian Angel and Vincent Liu},
  title = {{Fault-tolerant and Transactional Stateful Serverless Workflows (extended version)}},
  year = {2020},
  eprint = {2010.06706},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.06706},
}
Figure