DIY Serverless at Home – Going open-source

One of the drawbacks of using Functions-as-a-service (FaaS) with the likes of Amazon is vendor lock-in.  All of your APIs and extensibility are specific to that vendor. Project riff, an open source platform from Pivotal Software, aims to change that.

Riff was shown at the recent SpringOne Platform in December and runs Java microservices using the popular Spring framework.  Riff achieves this by packaging up your code snippet into a Kubernetes container. When your function is called, the container orchestration spins up a new container, runs your code and then kills it off afterward. There’s language specific function invoker which supports Python, Javascript, shell scripts and of course Java.

It relies on a ‘sidecar’ component which marshals communications between the event trigger and your code, ensuring your code is called in response to your chosen event, signal or notification. These events are largely focussed around HTTP calls at present.

One of the nice things is that Riff supports (or plans to support) event streaming, basically meaning that your container (code) will stay alive for more than a single call, keeping the function ‘warm’ to avoid the common pitfall of cold-start wait times, and allowing the system to scale better.

Riff isn’t alone, there are other efforts to create open-source Serverless alternatives, such as OpenFaaS, Kubeless, OpenLambda, Apache OpenWhisk and the Serverless framework. As the market is young we’re still waiting for the community to settle on a few ‘leaders’, so you don’t end up coding against the next BetaMax.

Over the long term these frameworks will find their niche, perhaps not as a complete replacement for the Big Three cloud vendors’ offerings, but maybe to compliment them in providing a quick and easy way of spinning something up locally, or on an old PC in the corner as a proof of concept.

It is nice to see frameworks trying to simplify the containerization route, which currently involves learning a lot of new commands and syntax. Early days and exciting times.

Leave a Reply

Your email address will not be published. Required fields are marked *