DEV Community

Cover image for What is serverless (and FaaS)
Ashok Nagaraj
Ashok Nagaraj

Posted on

What is serverless (and FaaS)

The need for Serverless computing

Serverless is a cloud computing model that can help you:

  • Save money by paying only for what you use and avoiding idle resources.
  • Save time by focusing on writing code and not managing servers or infrastructure.
  • Scale easily by letting the provider handle the demand and availability of your applications.
  • Innovate faster by leveraging existing services and platforms that offer various functionalities.

Image description
Image credit: https://www.datavizz.in/what-is-serverless-computing/

FaaS

Functions as a Service (FaaS) is a type of serverless service that lets you execute self-contained code on-demand in response to events. With FaaS, the provider will spin up a server when a function is triggered, execute the function, then shut down the server. FaaS offerings are only active when the function is being used, allowing the same computing resources to be allocated elsewhere when the server is shut down.

Serverless v/s FaaS

Serverless is a broader cloud computing model that encompasses any service category where configuration, management, and billing of servers are invisible to the end user. Serverless services can include compute, storage, database, messaging, API gateways, etc. Serverless services can also leverage FaaS platforms for custom logic or backend functionality.

Some of the main differences between FaaS and serverless are:

  1. FaaS is focused on executing code while serverless covers a wider range of services.
  2. FaaS requires you to write stateless functions while serverless can support stateful applications through other services such as databases or caches.
  3. FaaS has limitations on execution time and memory usage while serverless can offer more flexibility depending on the service type.
  4. FaaS charges you based on function invocations and duration while serverless charges you based on different metrics such as storage capacity or API requests depending on the service type.
When to use them

FaaS and serverless can be useful for different scenarios depending on your needs and preferences. For example, you might use FaaS if you want to:

  1. Run short-lived functions that perform simple tasks such as data processing, image resizing, or notifications.
  2. Use multiple languages and frameworks for your functions.
  3. Have more control over your function code and dependencies.

You might use serverless if you want to:

  • Build stateful applications that require persistent storage or caching34.
  • Use a wider range of services such as databases, messaging, API gateways, etc.
  • Have more flexibility over your execution time and memory usage

Reference links

Top comments (0)