Learn About

FaaS

What is FaaS (Function-as-a-Service)?

FaaS (Function-as-a-Service) is a type of cloud-computing service that allows you to execute code in response to events without the complex infrastructure typically associated with building and launching microservices applications.

Hosting a software application on the internet typically requires provisioning and managing a virtual or physical server and managing an operating system and web server hosting processes.

FaaS vs Serverless

Serverless and Functions-as-a-Service (FaaS) are often conflated with one another but the truth is that FaaS is actually a subset of serverless. Serverless is focused on any service category, be it compute, storage, database, messaging, api gateways, etc. where configuration, management, and billing of servers are invisible to the end user. FaaS, on the other hand, while perhaps the most central technology in serverless architectures, is focused on the event-driven computing paradigm wherein application code, or containers, only run in response to events or requests.

Benefits of FaaS

FaaS is a valuable tool if you’re looking to efficiently and cost-effectively migrate applications to the cloud. The following are some benefits you will enjoy:

  • Focus more on code, not infrastructure: With FaaS, you can divide the server into functions that can be scaled automatically and independently so you don’t have to manage infrastructure. This allows you to focus on the app code and can dramatically reduce time-to-market.
  • Pay only for the resources you use, when you use them: With FaaS, you pay only when an action occurs. When the action is done, everything stops—no code runs, no server idles, no costs are incurred. FaaS is, therefore, cost-effective, especially for dynamic workloads or scheduled tasks. FaaS also offers a superior total-cost-of-ownership for high-load scenarios.
  • Scale up or down automatically: With FaaS, functions are scaled automatically, independently, and instantaneously, as needed. When demand drops, FaaS automatically scales back down
  • Get all the benefits of robust cloud infrastructure: FaaS offers inherent high availability because it is spread across multiple availability zones per geographic region and can be deployed across any number of regions without incremental costs.

Principles and best practices

There are several best practices you can follow to make using FaaS easier to deploy and more effective:

  • Make each function perform only one action: FaaS functions should be designed to do a single piece of work in response to an event. Make your code scope limited, efficient, and lightweight so functions load and execute quickly.
  • Don’t make functions call other functions: The value of FaaS is in the isolation of functions. Too many functions will increase your costs and remove the value of the isolation of your functions.
  • Use as few libraries in your functions as possible: Using too many libraries can slow functions down and make them harder to scale.