What is FaaS? Why it is important to me?

Pramod Dharbhashayanam
9 min readMay 12, 2020

Thanks to cloud computing, deploying our applications is much easier than it used to be. Just because of this cloud computing, moving to AWS/Azure/GCloud became as inevitable choice for small to big companies. After moving to cloud, becoming DevOps enabled is another essential strategy for everyone as we need to build fast, deploy fast, fail/recover fast with time to market as key mantra. After Cloud migration and DevOps (CI/CD), Function as a Service or FaaS is the word that gaining lot of traction and becoming buzz word in the industry circles. To be in line with digital transformation that software world is undergoing, we need to understand the importance and impact of these buzz words on our professional careers.

What is this “as a service”?

With cloud and DevOps added as catalysts, the concept of anything as a service arouse and it evolved like anything in last 5 years. APIs are are first step towards scalable services and micro services strategy took it to another level with Netflix and AWS proven models. Monolithic to leveraging these API calls to micro services is almost as paradigm shift in design thinking.

There are several cloud models, before we go into FaaS, we need to understand these models first.

The three terms distinguish between the primary cloud computing service models: ‘Software as a Service’, ‘Platform as a Service’, and ‘Infrastructure as a Service’. Since cloud computing can fulfill virtually any IT need imaginable (and often in many different ways), these classifications are necessary to indicate the role that a particular cloud service fulfills, and how that service accomplishes its role. In other words, SaaS, PaaS, and IaaS are the three main paradigms of cloud computing.

IaaS (Infrastructure As A Service) is a cloud model in which the provider supplies a complete infrastructure like virtual machines, virtual networks and more. This is easier choice to go to cloud as it will be lift and shift of apps from On-Prem to cloud. In a nutshell, app stack will not be changed but the infra management will be moved from companies to cloud. IaaS is the lowest-level cloud service paradigm and arguably the most important. With IaaS, pre-configured hardware resources are provided to users through a virtual interface.

Unlike PaaS and SaaS, IaaS doesn’t include applications or even an operating system (implementing all of that is left up to the customer), it simply enables access to the infrastructure needed to power or support that software. Popular IaaS offerings like Amazon EC2, IBM SoftLayer, and Google’s Compute Engine (GCE) are silently powering a huge portion of the backbone of the internet, whether users realize it or not.

PaaS (Platform As A Service) is yet another cloud model, and its providers’ focus is on providing a software development environment to its users. PaaS offerings typically include a base operating system and a suite of applications and development tools The entire idea is to give developers the tools and the software they need in a single, virtual place. If IaaS gives the infra on which you can build your own applications and their integrations etc, PaaS is complete development environment as a Service on which you can build your applications without worrying about installation of databases and other managed servers. .

Gartner defines PaaS as a cloud service model where the cloud is used to deliver a platform to users from which they can develop, initialize and manage applications. So its one more layer above IaaS where along with infra you need not manage computing services too. These computing services may include networking, storage, databases, software, analytics, and easy tools to integrate with 3rd party services. PaaS eliminates the need for organizations to build and maintain the infrastructure traditionally used to develop applications. PaaS is sometimes called ‘middleware’, referring to how it conceptually sits somewhere between SaaS and IaaS. Platform’s like Google’s App Engine, IBM BlueMix, and Apache’s Stratos are popular PaaS products which are helping to streamline and democratize software development.

SaaS (Software As A Service) is another cloud model in which the provider does not expose the virtual computers or even networks to users. Instead, it provides access to databases or any other software services, and this allows the users to be free of maintenance of operating systems while the user can remain focused on the actual usage of the software. By 2012, software-as-a-service (SaaS) gained popularity and the concept of multi-tenancy began to gain acceptance. SaaS is like staying at a hotel, where all of the services are provided. You arrive and are handed your access (room key) and you simply pay to use the hotel room.

SaaS offerings are typically accessed by end users through a web browser (making the user’s operating system largely irrelevant) and can be billed based on consumption or, more simply, with a flat monthly charge. SaaS offerings are the most widely visible of all the cloud computing service models. In fact, many users might be using SaaS products without even realizing it. Popular products like Office365 and Salesforce have thrust SaaS offerings to the forefront of the workplace and are used by thousands of businesses every day.

Function as a Service

Last but not least, FaaS (Function As A Service) is an entirely new cloud model and a game changer to many. FaaS belongs to a category of CCS (Cloud Computing Services) which provides a platform for customers to develop, run, and manage applications. FaaS is the concept of serverless computing via serverless architectures. Software developers can leverage this to deploy an individual “function”, action, or piece of business logic. They are expected to start within milliseconds and process individual requests and then the process ends. Generally to have some business logic to run, we need to write the code, package it and deploy into an application server. FaaS removes all other burden and let you have laser focus on the business logic that you need to code as a function and all other parameters will be taken care by FaaS provider like server, infra etc.

Principles of FaaS:

· Complete abstraction of servers away from the developer

· Billing based on consumption and executions, not server instance sizes

· Services that are event-driven and instantaneously scalable

Doing so without the complex maintenance and building of infrastructure that is usually associated with the development and the launch of an app. Building the app while following this model is a way to achieve a “serverless” architecture. This model is mostly used for building micro-services. Function As A Service is still very young and brand-new in cloud computing. FaaS was first introduced and made available to the world by hook.io in late 2014 and was shortly followed by AWS Lambda, Google Cloud Functions, Microsoft Azure Functions and many others.

What services fit into FaaS?

Like most things, not every app is a good fit for FaaS. Below categories of logic can be envisoned as FaaS models:

· Super high volume transactions — Isolate them and scale them

· Dynamic or burstable workloads — If you only run something once a day or month, no need to pay for a server 24/7/365

· Scheduled tasks — They are a perfect way to run a certain piece of code on a schedule

· Process a web request

· Process queue messages

· Run manually

These functions could also be chained together. For example, a web request could write to a queue, which is then picked up by a different function.

Is FaaS and micro services are same?

No. FaaS can be treated as next avatar of micro services. Micro services may be inspirational foundation behind FaaS model but with advent of cloud computing, FaaS is next generation of Micro services. If a web application were a work of visual art, using micro-service architecture would be like making the art out of a collection of mosaic tiles. The artist can easily add, replace, and repair one tile at a time. Monolithic architecture would be like painting the entire work on a single piece of canvas.

This is approach of building an application out of a set of modular components is known as micro-service architecture. Dividing an application into micro services is appealing to developers because it means they can create and modify small pieces of code which can be easily implemented into their code base. This is in contrast to monolithic architecture, in which all the code is interwoven into one large system. With large monolithic systems, even a minor changes to the application requires a hefty deploy process.

In Micro-services deploying the logic and working on servers still a task. FaaS simplifies this task by eliminating servers and deployments and allows you to focus on logic/code. In a nutshell using server-less code like FaaS, web developers can focus on writing application code, while the server-less provider takes care of server allocation and back-end services.

Comparing FaaS vs PaaS

Platform-as-a-Service greatly simplifies deploying applications. It allows us to deploy our app and the “cloud” worries about how to deploy the servers to run it. Most PaaS hosting options can even auto-scale the number of servers to handle workloads and save you money during times of low usage. PaaS offerings like Azure App Services, AWS Elastic Beanstalk, and others, make it easy to deploy an entire application. They handle provisioning servers and deploying your application to the servers.

Function-as-a-Service (FaaS) provides the ability to deploy what is essentially a single function, or part of an application. FaaS is designed to potentially be a serverless architecture. Although, some providers, like Azure, also allow you to dedicate resources to a Function App.

When deployed as PaaS, an application is typically running on at least one server at all times. With FaaS, it may not be running at all until the function needs to be executed. It starts the function within a few milliseconds and then shuts it down. Both provide the ability to easily deploy an application and scale it, without having to provision or configure servers. Another difference is FaaS services charge per execution time of the function and PaaS services charge per running time of the thread where the server application is running.

What are the advantages of using FaaS?

Improved developer velocity

With FaaS, developers can spend more time writing application logic and less time worrying about servers and deploys. This typically means a much faster development turnaround.

Built-in scalability

ince FaaS code is inherently scalable, developers don’t have to worry about creating contingencies for high traffic or heavy use. The server-less provider will handle all of the scaling concerns.

Cost efficiency

Unlike traditional cloud providers, server-less FaaS providers do not charge their clients for idle computation time. Because of this, clients only pay for as much computation time as they use, and do not need to waste money over-provisioning cloud resources.

What are the drawbacks of FaaS?

Less system control

Having a third party manage part of the infrastructure makes it tough to understand the whole system and adds debugging challenges.

More complexity required for testing

It can be very difficult to incorporate FaaS code into a local testing environment, making thorough testing of an application a more intensive task.

Monitoring Challenge

One of the big challenges is monitoring your function apps. You still need to understand how often they occur, how long they take, and potentially, why they are slow. Since you don’t necessarily have a server or control the resources they are running on, you can’t install any monitoring software.

FaaS Case Studies

If you aren’t too sure if you are ready to take the plunge into FaaS, maybe a case study will help!

· Netflix uses AWS Lambda to help manage their AWS infrastructure with event-based systems.

--

--