Ditch The Server!

A Look at the Serverless Framework

The Serverless framework gave Serverless its name, so I wanted to take a closer look at what it provides, and how it contributed to where we are today.

The framework is downloadable from serverless.com and provides a command line interface (CLI) for creating and manipulating serverless functions.

It works with:

Amazon AWS

Microsoft Azure

IBM OpenWhisk

Google Cloud Platform

Kubeless

SpotInst

Auth0 Webtasks

It ships as an NPM package and relies on NodeJS v6.5.o or greater. The basic framework is installed via npm install -g serverless and then you add the vendor-specific extension packages (such as npm install -g serverless-azure-functions for Azure). At the time of writing the latest version is 1.26.1, and like a lot of NPM packages, it pulls in quite a screenful of dependencies.

The interface runs under Node so should work where-ever Node runs, so you’re covered on Windows, Mac, and Linux.

Creating

Functions can be created by the CLI using templates. If you look at the help you get a complete list of available out-of-the-box templates:

Deploying

You can either deploy your entire service with a straightforward serverless deploy command, or deploy individual functions which is useful for small incremental changes. Because your configuration is also stored as code, you get repeatable deployments as well as cross-compatibility.

Impressions

The serverless framework provides a useful layer above the cloud vendor’s implementation, abstracting away differences and making your code more portable. Although the decision to change between cloud vendors isn’t taken lightly or often, it’s good to know that it can be done without major upheaval. This does of course depend on the other services you may be utilising, such as blob storage, databases, and queueing systems. The serverless space is still young, but projects such as this help move the state-of-the-art forward. We’ll never get Microsoft and Amazon to agree on a common interface so we’re always going to need abstractions like this.