Uncategorized

Anatomy of a Functions as a Service (FaaS) Solution

The purpose of this blog is to describe the components of a Functions as a Service (Faas) solution to better understand how they work and what makes a total solution. I’m referring to it as a FaaS solution because in most cases I expect that additional components will be required to pair up with the FaaS system for any given overall solution.

FaaS Conceptual Design

The above diagram attempts to generically layout a conceptual design for a FaaS system. This diagram may not be perfectly accurate for all FaaS solutions but as mentioned above the intent is to increase understanding of FaaS solutions in general.

FaaS System Components

Function Store

Stores the functions that will be available to the users of the FaaS system. Functions being the pieces of code that complete a given task, for example, execute a machine learning derived algorithm to identify an image. Functions are in some cases zipped up with their dependencies or potentially packaged in an OCI format for container images.

Function Mapper

The function mapper maps functions to the runtime environment and dependencies that are required for the function to execute.

Scheduler

The scheduler schedules the functions and dependencies to run on the runtime environment. This is either done based on an event when a requirement to scale up capacity is generated or one or more functions can be kept ‘hot’ to avoid startup latency.

API Gateway

The API gateway surfaces the functions to the consumers and is the endpoint by which users of the FaaS system leverage the functions be they calling the functions directly or as is more likely the case via code.

Event Mapper

The purpose of the Event Mapper component is to map events from the event system to functions that will be triggered by those events. An example of an event could be an image being copied to an object store which then needs to be resized to a consistent format.

Examples

Some examples of FaaS systems are:

An example of some work VMware is doing in the FaaS space is the vCenter Event Broker Appliance (VEBA) which enables customers to easily create event-driven automation based on vCenter Server Events.

Event System

An event system might be integrated into the FaaS components or it may be an external messaging system such as an MQTT server. Once the FaaS solution is subscribed to the event system the applicable events in the event system can be mapped to functions.

Run Time

The runtime component is where the functions run. There are multiple different solutions to the runtime for FaaS solutions. Systems like OpenFaaS and KNative leverage Kubernetes. OpenFaaS also has a project that enables the functions to run on single hosts using containerd. AWS Lambda runs functions directly on hosts and therefore the functions must be packaged with their required dependencies and care needs to be taken to ensure that they are compatible with the underlying hosts that run the code.

Optional Complimentary Components

Stateful Storage

Stateful storage systems maintain an application’s state, this is important as a key tenet of functions that run on FaaS systems is that the functions themselves are stateless. Stateful storage systems have also been referred to as Backend as a Service systems or BaaS. These components are not solid requirements for FaaS systems but most FaaS solutions will require the usage of these components.

In this example website building how-to guide from Alibaba, they leverage an object store to store the HTML files for example.

Supercomputer Instantiator or ‘Transpiler’

As Tim Wagner of AWS Lambda fame details in the article The Serverless Super Computer serverless systems are enabling a change in the model of distributed computing. Supercomputer Instantiators take tasks that require massive computing power and break them up into individual functions that can be run on Serverless systems in a parallelized manner. Examples of such tasks are Video transcoding and software compiling.

Summary

This article has provided a brief introduction to the components that are required in a FaaS solution and also an overview of some of the components that are likely to be companions in some overall solutions that leverage FaaS. In future posts, we will discuss the evolution of FaaS solutions, some of the use cases they support and how solutions that utilize these components can be leveraged to solve business problems.

About The Author

James Wirth is a member of the emerging technologies team within VMware Professional Services and focuses on DevOps, Site Reliability Engineering, Multi-Cloud architectures and new and emerging technologies. He is a proven cloud computing and virtualization industry veteran with over 15 years’ experience leading customers through their cloud computing journey.