What is FaaS and How Does It Work?
FAQs
FaaS is good for applications without shared or persistent state that must be stored in RAM. Following functional programming best practices, this makes it particularly suitable for applications where shared state is stored in a database, meaning that the functions can spin up and execute in the minimum amount of time, storing all necessary data in the underlying database. Obviously, this means that your database needs to be able to scale alongside the execution of your FaaS functions.
Fundamentally, the key features of functions as a service are:
Ease of deployment.
Pay-as-you-go cost model
Automatic scaling of functions.
If these fit your requirements, then FaaS may be a good choice for you.
Generally, yes. FaaS is a platform that is usually provided by your cloud provider. But there's nothing to stop you from hosting your own instance of faasd (a lightweight FaaS server) and hosting your own functions on something as simple as a Raspberry Pi! The primary thing that differentiates FaaS from other architectures is the ability to deploy one or more functions to a system that will handle running them independently.
PaaS or platform as a service) is commonly used to describe cloud platforms that abstract away the infrastructure that they run on. A good example is Vercel which allows developers to build Next.js applications and deploy them to Vercel's infrastructure without worrying about how that underlying infrastructure works. In this way, FaaS can be considered a subset of PaaS, where the underlying unit of code is a function, which is a relatively simple unit consisting of inputs, outputs, and persistent services like databases) that are available for various tasks.
CaaS is short for containers as a service. The primary difference between CaaS and FaaS is that although both are deployed within containers (or lightweight VMs, in the case of AWS Lambda), in the case of CaaS, you have full control over the contents of the container. With a CaaS platform, you would author an entire service (usually following microservice idioms) and then package that up as a container. The host CaaS platform takes care of deploying, maintaining, and scaling these containers as necessary.
With a FaaS platform, the developer doesn't have control over the contents of the container. The developer only has control over the function's code and a list of dependencies required by that code. The rest of the container's contents is managed by the FaaS platform, and provides the necessary processes and supporting code to run and monitor the deployed function.
The primary benefit of function as a service is the ability to easily deploy small units of functionality (i.e., a single function) without having to worry about the server infrastructure that will be hosting the functions. By accepting some restrictions on shared state and startup time, huge amounts of scalability are possible without writing complex code or managing the complex infrastructure to enable it.
Get started with Atlas today
Get started in seconds. Our free clusters come with 512 MB of storage so you can play around with sample data and get oriented with our platform.
GET STARTED WITH:
- 125+ regions worldwide
- Sample data sets
- Always-on authentication
- End-to-end encryption
- Command line tools