FaasKeeper: a Blueprint for Serverless Services

Marcin Copik, Alexandru Calotoiu, Konstantin Taranov, Torsten Hoefler · DOI

Abstract

FaaS (Function-as-a-Service) revolutionized cloud computing by replacing persistent virtual machines with dynamically allocated resources. This shift trades locality and statefulness for a pay-as-you-go model more suited to variable and infrequent workloads. However, the main challenge is to adapt services to the serverless paradigm while meeting functional, performance, and consistency requirements. In this work, we push the boundaries of FaaS computing by designing a serverless variant of ZooKeeper, a centralized coordination service with a safe and wait-free consensus mechanism. We define synchronization primitives to extend the capabilities of scalable cloud storage and outline a set of requirements for efficient computing with serverless. In FaaSKeeper, the first coordination service built on serverless functions and cloud-native services, we explore the limitations of serverless offerings and propose improvements essential for complex and latency-sensitive applications. We share serverless design lessons based on our experiences of implementing a ZooKeeper model deployable to clouds today. FaaSKeeper maintains the same consistency guarantees and interface as ZooKeeper, with a serverless price model that lowers costs up to 110-719x on infrequent workloads.

Introduction

Distributed systems rely heavily on coordination services like Apache ZooKeeper to manage configuration, consensus, and group membership. However, ZooKeeper is fundamentally "server-centric," requiring a cluster of persistent virtual machines running 24/7. For modern serverless applications that aim to "scale to zero" and pay only for what they use, traditional ZooKeeper is an expensive, over-provisioned relic.

FaaSKeeper represents a radical alternative: a coordination service built entirely on top of stateless functions and cloud-native storage. By disaggregating compute from storage, it provides ZooKeeper’s API and consistency guarantees without requiring any managed servers, reducing costs by up to 700x for infrequent workloads.

The Serverless Gap

The primary hurdle in building serverless coordination is the "Serverless Gap." While Function-as-a-Service (FaaS) platforms like AWS Lambda are ideal for stateless tasks, they lack three critical requirements for coordination:

  1. Statefulness: Functions are ephemeral and lose memory between calls.
  2. Ordering: FaaS lacks built-in mechanisms to ensure requests are processed in a specific, global order.
  3. Fast Communication: There are no direct, long-lived TCP connections between functions to facilitate consensus.

Currently, developers either pay for idle ZooKeeper VMs or attempt to implement coordination using raw cloud storage (like S3 or DynamoDB), which often lacks the necessary atomic primitives or "watch" notification semantics required for complex distributed logic.

Architecture: From Servers to Functions

FaaSKeeper decomposes the traditional ZooKeeper architecture into a cloud-native pipeline. The persistent Leader and Follower roles are replaced with stateless functions that interact with managed cloud services.

Comparison between traditional ZooKeeper (a) and the serverless FaaSKeeper (b) architecture.

In this architecture, Follower Functions receive write requests, acquire "timed locks" in a database, and validate operations. Leader Functions are triggered by a queue to finalize transactions, replicate data, and trigger notifications. To maintain ZooKeeper's total order of transactions (the zxid), FaaSKeeper utilizes FIFO cloud queues (like AWS SQS FIFO). This ensures that updates are committed in the exact order they were received, even with multiple concurrent functions.

Design Lessons: A Blueprint for Serverless

The transition from Infrastructure-as-a-Service (IaaS) to FaaS requires a systematic approach to disaggregation and mapping. FaaSKeeper serves as a blueprint for this transition by following a specific optimization path.

The blueprint for transitioning from IaaS to FaaS services through disaggregation, mapping, and optimization.

Key design principles include:

  • Disaggregation of Compute and Storage: Separating logic from persistence allows the service to scale compute resources to zero when idle.
  • Hybrid Storage Optimization: FaaSKeeper uses high-performance Key-Value stores (e.g., DynamoDB) for metadata while offloading larger payloads to cheaper Object Storage (e.g., S3).
  • Wait-Free Consensus: Instead of active heartbeating (Paxos/Raft), FaaSKeeper leverages the cloud provider's internal consistency as the "source of truth," making the service resilient to individual function failures.

Evaluation and Performance

Evaluated using the Yahoo! Cloud Serving Benchmark (YCSB) and microbenchmarks on AWS and GCP, FaaSKeeper demonstrates significant advantages for specific workloads:

  • Cost Efficiency: For bursty or infrequent workloads, FaaSKeeper is 110x to 719x cheaper than a minimal 3-node ZooKeeper cluster.
  • Throughput: The system handles up to 1,200 requests per second, sufficient for many coordination use cases.
  • Read Performance: By utilizing in-memory caches alongside cloud storage, read latency remains comparable to self-hosted ZooKeeper.

However, these benefits come with trade-offs. Write latency is higher due to multiple cloud service interactions (Queue -> Function -> DB), and current cloud FIFO queues can become throughput bottlenecks for single client sessions.

Conclusion

FaaSKeeper proves that complex, consistency-sensitive services can be successfully ported to serverless environments. While write latency remains a challenge, the massive cost savings and elastic scaling make it a compelling choice for modern cloud-native applications. Future improvements in cloud provider offerings, such as decoupling I/O from compute billing, will further enhance the viability of serverless coordination services.

Summary updated

BibTeX
@inproceedings{copik2024faaskeeper,
  author = {Marcin Copik and Alexandru Calotoiu and Konstantin Taranov and Torsten Hoefler},
  title = {{FaasKeeper: a Blueprint for Serverless Services}},
  booktitle = {HPDC},
  year = {2024},
  doi = {10.1145/3625549.3658661},
}
Figure