Abstractions for efficient and reliable serverless computing
Keywords: Engineering.

Serverless, also known as function-as-a-service (FaaS), is an increasingly important paradigm in cloud computing. Developers register functions to a managed FaaS platform to serve user requests without the need to maintain their own servers. FaaS abstracts away the complexity of managing infrastructure, offers high availability, and automatically scales. However, today's FaaS platforms are often inefficient and unreliable, leaving developers with several complex application management challenges. Specifically, there are three key challenges: (1) minimizing cost while maintaining performance under varying load, (2) providing strong fault-tolerance guarantees in the presence of failures, and (3) improving debuggability and observability for distributed ephemeral functions. In this dissertation, we describe three new abstractions and build three systems to enhance the cost-efficiency, reliability, and debuggability of FaaS applications. We focus on two important categories of FaaS applications: compute-intensive, such as image recognition services, and data-centric, such as e-commerce web services. First, we address the challenge of cost efficiency for ML inference serving, a growing category of compute-intensive tasks. In particular, we tackle the key question of how to automatically configure and manage resources and models to minimize cost while maintaining high performance under unpredictable loads. Existing platforms usually require developers to manually search through thousands of model-variants, incurring significant costs. Therefore, we propose INFaaS, an automated model-less system where developers can easily specify performance and accuracy requirements without the need to specify a specific model-variant for each query. INFaaS generates model-variants from already trained models and efficiently navigates the large trade-off space of model-variants on behalf of developers to achieve application-specific objectives. By leveraging heterogeneous compute resources and efficient resource sharing, INFaaS guarantees application requirements while minimizing costs. Second, we address the challenge of providing fault tolerance while achieving high performance for data-centric applications. Existing FaaS platforms support these applications poorly because they physically and logically separate application logic, executed in cloud functions, from data management, done in interactive transactions accessing remote databases. Physical separation harms performance, and logical separation complicates efficiently providing fault tolerance. To solve this issue, we propose Apiary, a high-performance database-integrated FaaS platform for deploying and composing fault-tolerant transactional functions. Apiary wraps a distributed database engine and uses it as a unified runtime for function execution, data management, and operational logging. By physically co-locating and logically integrating function execution and data management, Apiary delivers similar or stronger transactional guarantees as comparable systems while significantly improving performance, cost, and observability. Finally, we delve into the challenge of debugging distributed data-centric applications. These applications are hard to debug because they share data across many concurrent requests. Currently, developers need to unravel the complex interactions of thousands of concurrent events to reproduce and fix bugs. To make debugging easier, we extend the tight integration between compute and data in Apiary and explore the synergy between the way people develop and debug their database-backed applications. We propose R^3, a "time travel" tool for data-centric FaaS applications that access shared data through transactions. R^3 allows for faithful replay of past executions in a controlled environment and retroactively execution of modified code on past events, making applications easier to maintain and debug. By recording concurrency information at transaction-level granularity, R^3 enables practical time travel with minimal overhead and supports most production DBMSs. We demonstrate how R^3 simplifies debugging for real, hard-to-reproduce concurrency bugs from popular open-source web applications