Serverless Implementation for FaaS- Pay Per Compute(PPC)

Kapalesachin
6 min readApr 11, 2020

Before we start our journey on Serverless, I just want to tell you that Serverless doesn’t mean there are no servers involved. It just means the third party manages the server for you & all you need to concentrate on application & data. Let me take you on the journey of Serverless computing.

Because of the multiple cloud offerings from multiple vendors, there is significant reshuffling in the way organizations handle infrastructures. In order to stay in competitions, cloud vendors started providing PaaS as well as SaaS services, so organizations stick around with vendors. For example Oracle & Microsoft started offering their products on its cloud platform as PaaS and SaaS. There is also new set of offering surfaced by majority of the cloud vendors like AWS, GCP,Azure & Oracle i.e Serverless Architecture.

As you can see in below diagram we have evolved from On prem to SaaS. The more we move towards right we have less & less control on components. At the same time organizations are getting benefited in terms of cost & lesser maintenance related issues. And one can fully concentrate on addressing real business problems.

Green layers represent the one managed by you & orange ones are managed by third party vendor for you.

Industry Evolution

Over a period of time two more type of service offerings like BaaS & FaaS came into play. These services started getting more traction because of microservice architecture.

BaaS -Backend as a Service, these services are developed as standalone services. It is also called mBaaS mobile BaaS which is cloud model of providing backend servicing. It is offering various backend features that are essentials for backend services of every application. This gives a benefit of independent development of backend services and it is a completely functional application backend. Later this service can be used by any front-end developer.

FaaS-Function as a Service, is targetted for code that can be scaled and providing a highly cost-effective solution. FaaS is different as compared to BaaS in the aspect of functionality for which it is developed, FaaS don’t serve as backend services they are triggered based on events and stateless by default in nature.

In all these models we have only concentrated on, who is basically managing the infrastructure. In today’s world, organizations try to be abstracted from basic infrastructure management & concentrate on quick to market for running a successful business. Everyone is more focused on addressing actual business problems or meet customer needs.

It makes sense for any business if anyone want to launch a website for business I am really not going to start from machine-level code. I will prefer to concentrate on business problems rather than dealing with other idiosyncrasies & avoiding areas in which I am not an expert. Lot of time in the organization’s IT Ops team is shared across multiple divisions, so they really don’t have a close understanding of business ask & implications. Some organizations are still in ticketing world.Industry is still slowly migrating towards DevSecOps so Ops will be work closely with development in future and this pain will go away.

FaaS Implementationaption

Recently FaaS got more attention because lot of loosely coupled patterns immerged, so all the cloud vendors provided a way to easily deployable FaaS with Pay Per Compute plans. You pay for the duration for which you used resources like CPU & Memory in terms of computing time. This is mostly a win-win model for both cloud vendors as well as the user. That gave birth to Serverless computing in the cloud world for deploying FaaS.

Every cloud vendor calls serverless computing with multiple names AWS offers it as Lambda, while others like Azure,Google & Oracle calls them functions.

Let us see what are the advantages of serverless implementations,

  1. Reduced Operational Cost
  2. Reduced Development Cost
  3. Scaling Cost
  4. Reduced packaging & Deployment cost
  5. Faster to market
  6. Greener computing

Let us understand how it helps in reducing operational as well as development cost, as there is no particular server involved for you to manage,so it frees in terms of platform support. Underlying details are abstracted for your implementation like OS, application server, memory management, processing capabilities. This also simplifies development as you are not running any underlying servers, you are free to choose the platform even during your development & before testing an application on your local you don’t have to too much worry about standing up equivalent or lesser capacity platform. For example a runnable jar file is sufficient to get it deployed & exposed it as a service.

Scaling- Serverless computing makes scaling way much easier since it doesn’t reserve the infrastructure upfront & most of the deployments on cloud platforms are scaled to any capacity based on number of requests.

Reduced packaging & Deployment -Since most of the cloud implementations don’t expect great level of packaging on application server,so the mode of packaging is very simple & deployment is completely abstracted from end user. This keeps you away from handling your CI/CD platform.

Faster to Market -As you have noticed multiple advantages which are typically need to be taken care during traditional software development lifecycle. Serverless gives extra edge where you don’t have to worry about lot of things & that makes you go in production as early as possible. It cuts down your significant time at multiple stages during development.

Green Computing- This one is my favorite, as mentioned above code is kept at some storage location & will be deployed only when some event or some request is triggered. There are no definite resources allocated all the time, they are requested and used only from infrastructure where it is available. This infrastructure is not stood up all the time that helps in keeping servers down.

Someone might argue if there are so many advantages then why it is not so widely used, here are some of things to keep in mind about the implementation of serverless architecture

Limitation of Serverless Implementation

Below are some of the major limitation sevrerless implementation has which makes it being so widely used, let us carefully go through each one of them & see if it impacts our business use case & how to overcome it if possible,

  1. Vendor Control
  2. Multitenancy problems
  3. Loss of server optimization
  4. Startup latency

Vendor Control: Underlying infrastructure is totally abstracted so pretty much you have to live with vendor’s platform choice. If you have compliance-related requirements for infrastructure ,it makes it difficult for you to find a way around.

Multitenancy problems: If you have privacy-related requirements about data & platform then this will not work for you. Typical multitenancy issues exist in serverless architecture since the infrastructure is not in your control, so this could be another problem.

Loss of server optimization: Invisible infrastructure leaves very little room for optimization by looking at server resource utilization. Physically you don’t have any server to get onto & do some kind of optimization.

Startup Latency: Other limitations can be overcome but this one is a real challenge as mentioned above in green computing as an advantage. Resources for computation is only procured only when an event gets triggered which make initial request serving slowly. This latency can be experienced during the initial requests, which makes it a little popular.

Conclusion: One can practically run lot of applications on Serverless infrastructure if application is designed carefully. I have practically ripped benefits of this implementation in the cloud & I see a great future in implementation on serverless infrastructure. I see lot of startups, as well as major enterprises, started using it for their in house activities.The most attractive benefit is cost ,you pay per compute & practically one can run small organization using Serverless architecture. With lot of organizations embracing it , so lot of startups are providing support & tooling around certain limitations of Serverless architecture. Potential growth is expected to rise by 75%, so this will be future.

This was something in draft mode from close to 6 month & finally I could get this out. I wanted to give one hands on example also, which I will fulfill in upcoming article till then happy learning.

--

--

Kapalesachin

Sachin Kapale works as a Director Of Technical Architecture.His other articles are available on http://www.sachinkapale.com