Function as a service (FaaS) is a cloud serverless computing service that provides event-driven, on-demand capabilities using a serverless architecture. FaaS is used for a variety of use cases and allows enterprises to program self-contained tasks that can be triggered once certain conditions are met.
How does FaaS work?
Functions are snippets of code that accomplish a specific task in response to events. The code can be written in many different languages, depending on the service provider. For example, AWS Lambda supports Python, Java, Go, Node.js, and Ruby, just to name a few. Once the code is written, these functions can be deployed on the service provider’s interface, without having to manually provision the infrastructure. Because functions are event-based, cloud resources are only spun up or down as needed on a pay-as-you-go model.
When should you use FaaS?
FaaS has a wide range of use cases and functions can be programmed to pick up on events such as a certain number of HTTP requests, data that meets certain standards, a user input, account creation, order placement, anything at all. In general, functions need to be specific and are best used for low-complexity activities.
A chatbot like Siri or Alexa is a great example of event-driven functions. When a user requests information, those commands can be routed to the event-driven functions deployed on the FaaS platform. The platform processes these voice commands and triggers the relevant functions, such as saying the time and date, get weather data, bus routes, etc.
The Internet of Things (IoT) provides several use cases of FaaS. A security camera performs object detection and sends an alert to your phone. A smart thermostat turns off once it hits a programmed temperature. Self-driving cars also use functions for obstacle avoidance and route selection.
FaaS enables enterprises to program actions without the burden of managing the infrastructure associated with those actions. Functions also provide much needed automation that is repeatable and reliable. Function capabilities are endless and are more than just a backend technology, they’re a critical component for a wide range of cloud applications.