What is Serverless?

Serverless computing describes a type of computing where the operating system and other systems have been abstracted away leaving only the application layer available to the end-user. These applications are run in stateless containers and are triggered by external events. Serverless is often referred to as Function-as-a-Service (FaaS). However, in general use, we use the descriptor serverless for cloud provider offerings because the end-user has no interaction with the server, while in Function-as-a-Service model the users maintain the infrastructure that provides the ability to deploy serverless computing.

Serverless Function Example

This is a simple example of how a serverless function would work on the popular Amazon Web Services platform.

Serverless Features

One of the key architecture patterns for serverless is that it’s an event-driven architecture. An event such as a change to a database or a message from the Apache Kafka streaming platform may be the trigger to execute a function.

Serverless, in contrast to hosted VMs, is priced based on the number of resources consumed typically execution time and amount of data transferred.

Typically functions are single use. They provide a single action such as look up an address or customer information. This variant of service-oriented architecture (SOA) provides fine-grained functionality that allowing small, autonomous pieces of code to work together.

One criticism of serverless is the “cold start” problem. Because functions aren’t always used the don’t reside in memory as they would like services running on a virtual machine. This can result in higher than desirable latency in applications dependent on these functions.

Serverless Compute Services

The three largest cloud providers Amazon, Google, and Microsoft all have serverless offerings. They all are very similar in capabilities and pricing but with nuances that are a result of their CLIs and interaction with other cloud services.

Amazon’s Lambda was introduced in November 2014 and ever since it has been the leading offering by the total number of users. The original workload for Amazon Lambda was Node.js a server-side JavaScript engine.  In 2018 Amazon open sourced the underlying code for Lambda in the FireCracker project.

Google Cloud Functions is Google’s serverless compute platform. It is integrated with many other Google cloud products and functions are typically triggered via Cloud Pub/Sub distributed message bus. Google’s serverless offering is built on top of the open source Kubernetes and Knative technologies.

Microsoft’s offering is Azure Functions which is part of the Microsoft Azure suite of cloud services.

Create your first event flow in under 5 minutes