Function as a Service or FaaS is a kind of cloud computing service that allows developers to build, compute, run, and manage application packages as functions without having to maintain their own infrastructure. FaaS is an event-driven execution model that runs in stateless containers and those functions manage server-side logic and state through the use of services from a FaaS provider.
FaaS solutions are available on major public clouds and can be provisioned on-premise, adding significant new capabilities to enterprise IT for app development. Get the cloud-native strategy guide to prepare to implement a serverless approach with FaaS.
Some popular examples of Function as a Service (FaaS) include:
- IBM Cloud Functions
- Amazon’s AWS Lambda
- Google Cloud Functions
- Microsoft Azure Functions (open source)
- OpenFaaS (open source)
FaaS is a way to implement serverless computing where developers write business logic that is then executed in Linux containers fully managed by a platform. Though usually a cloud computing platform using cloud computing services, the model is expanding to include on-premise and hybrid deployments as well. Serverless abstracts infrastructure concerns like managing or provisioning servers and resource allocation from developers and gives it to a platform, so developers can focus on writing code and delivering business value.
A function is a piece of software running business logic on an operating system. Applications can be composed of many functions. Using a FaaS model is one way to build an app with a serverless architecture, but with the increase in popularity of the serverless paradigm, developers are looking for solutions that support building serverless microservices and stateless containers.
FaaS gives developers an abstraction for running web applications in response to events, without managing servers. For example, uploading a file could trigger custom code that transcodes the file into a variety of formats. FaaS infrastructure is usually metered on-demand by the service provider, primarily through an event-driven execution model, so it’s there when you need it but it doesn’t require any server processes to be running constantly in the background, as platform-as-a-service (PaaS) would.
Modern PaaS solutions offer serverless capabilities as part of common workflows that developers can use to deploy applications, blurring the lines between PaaS and FaaS. In reality, entire applications will be composed of a mix of these solutions: functions, microservices, and long-running services
A provider makes your function available via an application programming interface (API) and manages resource allocation. Because functions are event-driven, not resource-driven, they are easily scalable and that scalability allows for increased efficiency and value. There are architectural constraints in order to enable some of these benefits, like time limits on the execution of a function, so a function needs to be something that can start up and run quickly.
Functions start within milliseconds and process individual requests. If there are several simultaneous requests for your function, then the system will create as many copies of the function as needed to meet demand. When demand drops, the application automatically scales down. Dynamic scaling is a benefit of FaaS, and is cost-efficient as well, because providers only charge for the resources that are used, not idle time.
When running on-premise, this dynamic nature can also increase your platform density, allowing more workloads to run and optimize resource consumption and functionality. An event-driven service that needs horizontal scaling can work well as a function, as well as RESTful applications. FaaS works well for high volume transactions and workloads that only happen every so often, like generating reports, image processing, or any scheduled tasks. Common FaaS use cases are data processing, IoT services, and mobile or web apps.
You can build an entirely serverless application using FaaS, or comprise an application of partially serverless and partially traditional microservices components to take advantage of newer technology and container orchestration systems like Kubernetes.
- Increased developer productivity and faster development time
- Not responsible for server management
- Easy to scale and horizontal scaling is managed by the platform
- Only pay for or consume resources when necessary and as needed
- Functions can be written in almost any programming language
Initially, FaaS and serverless meant more or less the same thing, but serverless has expanded to mean a larger set of architectural patterns and practices that make extensive use of common services in addition to custom business logic encoded in FaaS. Serverless can be used by microservices and even traditional apps, as long as they can be containerized and adhere to the dynamic scale and state management requirements.
The term “serverless” is also being used to represent managed services, like databases and messaging systems, where a developer or administrator is not required to operate the system since it’s being managed by a cloud provider or third-party company. The combination of FaaS and common back-end services (such as databases, messaging, and authentication) connected primarily through an event-driven architecture is what provides the best benefits for serverless developers.