PAAS — FAAS: Let’s understand the difference between pass and faas cloud service
Functions-as-a-Service (Faas)
FaaS is an inevitable part of the serverless framework. The compute containers characterized above, can exist as FaaS offered by major cloud providers such as AWS (eg AWS Lambda), Google Cloud (Cloud Function) and Azure (eg Azure Functions).
Functional Advantages:
No server management or maintenance needed
Stateless
Automatic scaling, fine grained to number of requests
Runs only when needed (triggered by events such as requests)
Platforms-as-a-Service (PaaS)
PaaS is very similar to FaaS, except that that it does not triggered by event, and is typically always on. This does not suit the serverless framework.
Functional Advantages
No server management or maintenance needed
Stateless
Automatic scaling, adjustable to number of instances running
Typically runs 24/7
Sounds very similar to FaaS right? However there is one key operational difference between the both of them: Scalability, which affects operating cost.
Understanding Differences
This is best explained by visualizing architectural diagrams with an example.
Case Study: Imagine that we are going to build an e-commerce chatbot. It will have 2 functions available to the end-user: search and payment.
Traditional 3-tiered Architecture
Much of the logic implemented for the chatbot will be handled within the server-side code. Any incoming requests related to the chatbot, is single-handedly managed by the chatbot server running 24/7. This is where usually PaaS come in by providing and managing everything you need to host and maintain the app, and you need only deploy the app to the platform.
Serverless Architecture
Let’s first explain some services that might be unfamiliar above:
Api Gateways — A HTTP server where routes and endpoints are defined in configuration, and each route is associated with a resource (functions in this case) to handle that route.
Authentication Service — It is what is says, a service that helps with the authentication. Typical providers are Auth0, AWS Cognito. These are usually called Backend-as-a-Service (BaaS), as they only require you to configure, and the provisioning and running of the service is already handled by the vendor. BaaS are commonly used with FaaS within the serverless framework, as both of them allow similar conveniences such as the absence of resource management.
Things to note:
The chatbot server is now separated to 2 different functions that will only be triggered when there’s a request coming in.
Our authentication function has been outsourced to a 3rd party service. We no longer have to write our own code.
BaaS is different from PaaS, in which BaaS serves the user for a specific need, such as authentication, or face recognition, whereas PaaS is a platform for users with the main purpose of easing their current methodology of doing things (such as easily creating web servers with Azure Web Apps).
Functions allow a new way to modularise our code giving us the flexibility of porting the same functions for a new project without changing anything.
Cost Comparison
Assume in a month we have to take in 1 million requests, and a container instance runs for 5 cents / hr (AWS Instance).
In the 3-tiered traditional architecture = $33.6:
total time taken for server to run = 28 days * 24 hrs = 672 hrs
total 1mth = $33.6
Serverless architecture = $13.85:
time taken for function to run = 1 sec
total time taken for server to run = 1000000 request* 1 sec= 1000000s = 277 hrs
total 1mth = $13.85
In our simple example above, the monthly price difference between the two models is under $19.75, but when scaled horizontally that $19.75 can be multiplied many times based on the demand.
Conclusion:
Even though Paas and Faas looks more similar there few nuance differences, so one must consider based on their requirements and bugdet. For serverless there is no need to maintaining the server and simple learn and deploy on other hand Paas services are costly and harder to maintain but most suitable for large scale applications. so, choose wisely.
Happy Reading 😊
Subscribe to my newsletter
Read articles from Sundaresan Anandan directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Sundaresan Anandan
Sundaresan Anandan
I am a tech enthusiast and have dedicated 5+ years of experience in software development. Currently, I am working as a solution engineer. Here my responsibilities are to directly interact with customers and fellow developers, then identify their pain points and figure out the solutions. Apart from that, I spent plenty of time code along with other developers, writing technical documents and preparing architecture diagrams.