What is OpenFaaS?

OpenFaaS is a framework and infrastructure preparation system for building serverless applications. It originated from the serverless framework in the Docker Swarm and now supports other kinds of infrastructure backends, such as Kubernetes or Hyper.sh. Functions in OpenFaaS are containers. Any program written in any language can be packed as a function by leveraging the container technologies of Docker. This enables us to fully reuse the existing code to consume a wide range of web service events without rewriting the code. OpenFaaS is a great tool for modernizing old systems to run on a cloud-based infrastructure.

There are several serverless frameworks out there in the cloud-native landscape. However, some problems need to be addressed by Alex Ellis, the original author of OpenFaaS. The driving factor behind the making of the framework is shaping the following, compelling features:

  • Ease of use: Basically, many serverless frameworks are complex to deploy by nature, as they are built by big companies and are serverless services. OpenFaaS, on the other hand, aims to be a serverless stack that is easy enough for developers and small companies to deploy and use on their own hardware. OpenFaaS also comes with a ready-to-use UI portal, which allows us to try out function invocation in the browser. OpenFaaS has autoscaling capability built in. It measures the load of function invocation automatically and scales instances up or down on demand.
  • Portable: There are several orchestration engines in the container ecosystem, notably Docker Swarm and Google's Kubernetes. OpenFaaS was first designed to work on Swarm and later on Kubernetes. Its functions are portable across these orchestration engines. Not only portable in a runtime sense, an OpenFaaS function is just a plain Docker container. This means that every kind of workload can be repacked as a function container and simply deployed on an OpenFaaS cluster. OpenFaaS runs on any infrastructure, including on-premises hardware, private clouds, and public clouds.
  • Simplicity in architecture and design: The architecture of OpenFaaS is simple. It consists of the API gateway for accepting requests. The API gateway then passes the requests to containers, functions with watchdogs, inside the cluster. Watchdog is a component of OpenFaaS which will be discussed shortly, in the next section. The gateway also keeps track of the number of function invocations. When the volume of requests is going to be large, the gateway will trigger the orchestration engine to scale replicas of functions on demand.
  • Open and extensible platform: OpenFaaS is designed to be open and extensible. With this openness and extensibility, the number of FaaS backends supported by OpenFaaS has been increasing over time, as anyone can contribute a new backend for OpenFaaS. For example, if we want to run functions directly in a container runtime, such as containers, for performance reasons, we can extend OpenFaaS by writing a new containerd backend for it.
  • Language agnostic: We can write OpenFaaS functions in any language supported by Linux or Windows, then pack them as Docker or OCI container images.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset