Faas — Explained

Edson Oliveira
3 min readNov 15, 2022

--

FaaS — Function as a Service.

figure — 1

Serverless Computing — Function as a Service.

You’ve already heard of Faas. In fact, when talking about cloud computing, this is a point that is often mentioned. Faas is a kind of serverless cloud computing, it is a function written by a Dev for a single purpose. This function is hosted and maintained on the infrastructure by cloud computing companies like AWS, Azure and GCP. These companies take care of code maintenance and execution so that Devs can deploy new code more quickly and easily. In addition, functions can be written in several languages. On AWS for example the languages are Java, Go, PowerShell, Node.js JavaScript, C# and Python. The function is triggered by some event that works as a trigger or trigger.

Scenario of use

In the figure below, we have an example of using FaaS. In this case, Lambda Function from AWS. In this scenario, the function is composing along with other serverless components like DNS, CDN, API Gateway and others. The function is triggered in response to the request event generated by the user and received in the Api Gateway.

figure— 2

Pros

Focus on code, not infrastructure: With FaaS, you can split the server into functions that scale automatically and independently so you don’t have to manage the infrastructure. This allows you to focus on application code.

Pay only for the resources you use, when you use them: With FaaS, you only pay when an action occurs. After the action is completed, a stop is made. No servers are idle, no costs are incurred. FaaS is therefore cost-effective, especially for dynamic workloads or scheduled tasks.

Auto scale up or down: With FaaS, functions automatically scale independently and instantly as needed. When demand drops, FaaS automatically drops.

Get all the benefits of a robust cloud infrastructure: FaaS offers inherent high availability because it is spread across multiple Availability Zones by geographic region and can be deployed in any number of regions without incremental costs.

Cons

Vendor Lock-in: Building your app on a FaaS platform can make you dependent on that vendor and make switching difficult.

Testing Difficulty: Depending on the vendor, you may have challenges when creating a test environment for your application.

Cold starts: In some cases, there may be delays in the execution of a function, up to 3 seconds, which can negatively affect some types of applications.

Cost: It is true that the cost issue can be beneficial to pay only and when to use, however in some cases FaaS can cost more than using dedicated servers depending on the processes you are running.

Limited lifetime, I/O bottlenecks, slow communication with the storages and lack of specialized hardware are also some problems pointed out by a UC Berkeley study (One Step Forward, Two Steps Back).

Conclusion

I believe that using functions is a good strategy for specific scenarios, for example, it fits very well with event-driven architectures, it by nature is triggered from events.

Was this article helpful? If yes, follow me to be notified when there are new publications.

Bibliography:

The recent UC Berkeley report Serverless Computing: One Step Forward, Two Steps Back

Paper review report Serverless Computing: One Step Forward, Two Steps Back

--

--

Edson Oliveira

Arquiteto de Software com Pós-graduação pela PUC RJ