Managing State in Ephemeral Cloud Functions

94 concepts63 papers1 proposal

Serverless computing—pioneered by Function-as-a-Service (FaaS) platforms like AWS Lambda—fundamentally changed cloud economics. It promised infinite horizontal scaling, fine-grained pay-per-use billing, and the complete elimination of the "cluster management tax." For stateless workloads like web APIs or simple event triggers, this model works flawlessly.

However, as Hellerstein et al. famously argued, the strict statelessness constraint of modern serverless platforms represents a significant architectural regression for data-intensive applications. When a function execution environment is short-lived and isolated, it cannot maintain long-term in-memory state. This forces a data-shipping model: every single function invocation must fetch its required data from a remote storage tier (like Amazon S3 or DynamoDB), process it, and ship the results back over the network before the container is destroyed.

For iterative, stateful tasks like distributed machine learning training (Jiang et al.), big data analytics (Lin et al.; Wawrzoniak), and stream processing (Zahra et al.), this data-shipping tax introduces massive latency and unsustainable network costs.

To bridge this gap, a new research direction has emerged: stateful serverless computing. The goal is to retain the elastic, hands-off scaling of FaaS while introducing mechanisms that allow functions to access and manipulate persistent state with low latency.


Co-locating Mutable State with Ephemeral Compute

The most direct way to eliminate the data-shipping bottleneck is to bring data closer to the execution context. If a function executor can reuse a local cache across multiple invocations, it avoids hitting remote storage every time.

Traditional FaaS (Data-Shipping):
[Function Executor] <====== Network ======> [Remote Cloud Storage]

Stateful Serverless (Co-located Cache):
[ Node: [Function Executor] <== Shared Memory ==> [Local Mutable Cache] ]
                                                        ||
                                                [Logical Storage Layer]

This is the core intuition behind Cloudburst, a platform developed by Sreekanti et al.. Cloudburst logically disaggregates storage from compute to preserve elasticity, but physically co-locates mutable caches directly on the function execution nodes. When a function updates an application state, it writes to this local cache. Subsequent function calls scheduled on the same node can read this state instantly via shared memory.

By integrating state management directly into the execution environment, the authors demonstrated performance improvements of over two orders of magnitude for data-intensive tasks compared to traditional stateless models. However, this approach introduces a new challenge: if the cloud provider aggressively reclaims or evicts idle containers—a common practice highlighted in the serverless benchmark suite by Li et al.—the local cache disappears, requiring robust background synchronization with the underlying persistent storage layer.


Shifting to Stateful Dataflows

Traditional serverless applications are structured as a series of isolated, remote procedure calls (RPCs) triggered by events. To maintain state across these calls without centralized databases, researchers have looked toward dataflow execution models.

In a stateful dataflow model, an application is represented as a directed graph of continuous operators. Instead of spinning up a function from scratch for every request, data updates flow continuously through long-running or rapidly re-initialized operators that maintain internal memory.

  • Declarative Optimization: The Hydro project by Cheung et al. proposes a programming stack where legacy code is compiled into a declarative intermediate representation called HydroLogic. This allows the underlying cloud infrastructure to automatically optimize how state updates flow through the system, handling consistency and scaling behind the scenes.
  • Continuous Streaming: Similarly, the Laminar framework by Zahra et al. organizes serverless logic into processing elements capable of retaining internal state across executions. This allows ephemeral functions to execute complex communication patterns like MapReduce and continuous stream processing natively.

When data rates spike, scaling these stateful operators is notoriously difficult because migrating an operator means migrating its historical memory. To bypass this bottleneck, systems like Sponge (Song et al.) employ a redirect-and-merge mechanism. Instead of waiting to migrate a massive state during a sudden burst of traffic, serverless functions are spun up instantly to handle incoming data using partial states. Once the burst subsides, these isolated partial states are merged back into the primary state tier, preserving low latency without full state migration overhead.


Flipping the Script: Functions as Storage Media

Perhaps the most counterintuitive breakthrough in this space is the realization that the limitations of serverless functions can be exploited to build high-performance storage infrastructure. If serverless platforms allow users to launch thousands of functions simultaneously, those functions collectively represent a massive pool of aggregate in-memory capacity.

Systems like InfiniCache (Wang et al.) and InfiniStore (Zhang et al.) flip the serverless paradigm on its head: they repurpose ephemeral functions as a distributed, elastic memory cache.

[ Client Application ]
         ||  (Read/Write Requests)
         \/
[ Coordinator Proxy ]  <== Erasure Coding & Heartbeats
         ||
         +=======> [ Lambda Instance 1 (In-Memory Chunk A) ]
         +=======> [ Lambda Instance 2 (In-Memory Chunk B) ]
         +=======> [ Lambda Instance 3 (In-Memory Chunk C) ]

To make this work, the architecture must overcome two severe platform constraints:

  1. No Inbound TCP Connections: Serverless functions typically cannot accept direct incoming network connections from clients (Wang et al.). To circumvent this, these architectures use a coordinator proxy that manages data routing and maintains persistent connections to the active function instances.
  2. Ephemeral Lifespans and Evictions: Because cloud providers can terminate idle functions at any time, data durability is highly volatile. The authors solve this by applying erasure coding to the cached objects. An object is broken into multiple data and parity chunks distributed across different function instances. If a subset of containers is evicted, the coordinator can reconstruct the lost data from the surviving instances, creating a highly resilient, pay-as-you-go storage tier that is significantly cheaper than provisioned cloud caches.

Enforcing Consistency and Fault Tolerance

When hundreds of parallel serverless functions read and write to a shared state layer, ensuring data consistency becomes a major hurdle. If a stateless function fails halfway through its execution and is retried by the platform, it can cause a fractional execution—a state where partial updates from the failed run remain visible to other concurrent processes, corrupting the application state.

To prevent this without introducing heavy, performance-killing coordination protocols, Sreekanti et al. developed AFT, an atomic fault-tolerance shim that sits between serverless functions and storage engines. AFT enforces read atomic isolation by tracking function execution lineages and ensuring that partial updates from failed function attempts are never exposed to concurrent processes.

By combining these consistency shims with cloud-native storage primitives, researchers have demonstrated that even highly complex, stateful coordination services—such as Apache ZooKeeper—can be successfully re-implemented on top of serverless architectures (Copik et al.), proving that the statelessness constraint is an implementation detail of early cloud platforms rather than an immutable law of serverless computing.

Key Foundational Work

Deciding Semantic Matching of Stateless Services (2006) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_serverless_state_management_1faf1ea6,
  title = {serverless state management},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/serverless-state-management/rdr_1faf1ea6a507475ba8509a9cd06abb26},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-24},
}

This exact version (version 1, frozen text):

@misc{lacuna_serverless_state_management_1faf1ea6_v1,
  title = {serverless state management},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/serverless-state-management/rdr_1faf1ea6a507475ba8509a9cd06abb26/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-24},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake