3 simple use cases for leveraging serverless or FaaS “Functions as a Service” in your enterprise.

This post was originally published on Linkedin: https://www.linkedin.com/pulse/3-simple-use-cases-leveraging-serverless-faas-service-kashyap

The inevitable shift:

As traditional colocation of workloads dwindles, it is apparent that the public cloud providers are taking over a significant portion of the hosting market share, while delivering innovation in almost every use case. Amazon’s AWS continues to pave the way for public cloud adoption and Microsoft’s Azure has become the second largest cloud platform, a commendable achievement considering other companies like IBM have also been innovating in the hosting and colocation for several decades.

Data source: Cloud Security Alliance

Enter Serverless computing:

Serverless computing or otherwise called FaaS “functions as a service” uses servers behind the scenes. The name stems from the simplicity of leveraging the platform without having to manage the servers. AWS has pioneered the serverless space with its release of AWS Lambda back in 2014. The rest of the major cloud providers quickly pivoted and have since released Azure Functions as a service, Google Functions and IBM Functions (Apache Openwhisk) respectively. IMHO — It is the “heir apparent” for IaaS, and perhaps in some cases a quick and easy replacement for PaaS. Another significant advantage to FaaS is you can choose to write your code in python, javascript and depending on the cloud vendor even Java, C#, PHP etc.

Plan ahead:

First read this: https://12factor.net/. Great! — now, If you are already using microservices and have already embarked on decoupling capabilities into distinct services, then you are probably going to find using FaaS pretty easy. The key to going serverless is to re-think your architecture from the ground up. It also helps to understand the limitations of each of the FaaS options available from the cloud providers. You have to redefine your testing patterns, for example, integration testing is going to become a whole new ball game. Keep in mind if your functions will run for several hours, you might find that using EC2, beanstalk or Azure IaaS may be a more economical option. Some quick observations: — 1) Keep it stateless 2) Put your logic on the client side if you can afford it 3) Think event-based architectures.

Use Case 1: Serving up static content

If you have static content or perhaps your application is built on sharing static content, leverage serverless and a robust front end to scrape your content directly from blob or S3. This is by far one of the easiest, fastest and most economical use cases for serverless. You will never have to worry about infrastructure provisioning or be worried about scaling your server instances to accommodate the load.

Use Case 2: ETL (Extract, Transform and Load)

Let’s say you happen to have an ETL job that takes data from a secure FTP site, transforms some of that data and loads the data into a database. You are probably running a third party ETL product or leveraging expensive SQL compute cycles on a server that is running 24x7 to perform the ETL process. Leveraging FaaS you can easily transform the application to a utility-based model and use functions “runs” to only execute and pay for that “run instance”. If you are using that expensive ETL licensing product or SQL server for the ETL job — you don’t need it anymore!

Use Case 3: Time based batch

If you are using some awesome batch scheduler with a ton of bells and whistles and a dedicated batch infrastructure, well you are probably still spending a ton of licensing fees to keep it going. Time to rethink batch! Build a FaaS trigger for your batch job. Simple timer based functions can call a plethora of endpoints and can also help you save on your licensing costs by getting rid of your batch schedulers!

Bottom Line:

Start small, experiment and mature. There are several reasons that serverless may not be the right fit for you, but if you have specific use cases that have dominated the enterprise environment and you want to move to a utility-based compute model, look no further.