A JavaScript Programming Model for Serverless Compositions

Samuel Baxter
University of Massachusetts Amherst, 2019

Web services grow increasingly complex as features, traffic, and resource demands increase. A monolithic server that previously met users’ needs might no longer scale once load balancing, replication, and elasticity become requirements. Because of this, monolithic servers often migrate to service-oriented architectures (also called microservices), where reusable logic is decoupled, databases are migrated to the cloud, and services are glued together through event-driven APIs. Serverless computing is a recent abstraction intended to simplify the development and deployment of such cloud applications. Serverless platforms simplify cloud applications by transparently managing operating systems, provisioned resources, load-balancing, and fault tolerance; programmers only write code for serverless functions and configure the interaction between services.

Unfortunately, developer tools are playing catch up in providing a familiar programming model for composing services into cloud applications; most existing tools specify compositions in YAML or JSON configuration files, or leverage domain-specific languages (DSLs). We introduce Distribufy, a new programming model for composing cloud services in JavaScript without having to learnan embedded DSL, while preserving serverless properties. Distribufy extends JavaScript with a checkpoint function that suspends a composition and serializes the runtime state, allowing the program to resume asynchronously (and potentially on another machine). Distribufy unifies the programming model for compositions with that of serverless functions, letting programmers write code for application logic and to orchestrate services, within a single program. We demonstrate the expressivity of our implementation through case studies, and show that it performs comparably to prior work.