What Is FaaS?
Function as a Service (FaaS) is a relatively new service of cloud computing. It provides a platform that helps users develop, manage and run functionalities of their applications without the complexities of building the infrastructure and maintaining it which always follows launching an app. FaaS in a brand-new development in cloud computing and it was presented in the world in October 2014 by the hook.io website. Since then, numerous FaaS providers came along like AWS, Google Cloud, Microsoft Azure, IBM/Apache’s Open Whisk which is open source from 2016 and Oracle Cloud in 2017 also being open source.
Advantages And Disadvantages Of Using FaaS
Let’s quickly run through all the awesomeness and pain points fo FaaS.
FaaS advantages
- Price – You will need to pay only for the resources you’ve used.
- Infrastructure management – Initial investment in buying servers and configuring them is expensive. Furthermore, you’ll need to invest in specialized staff.
- Infrastructure security – Worrying about Linux or Tomcat updates is a thing of the past. The Equifax breach, where a security update had a significant toll on their businesses, is behind us.
- Easy Deployment – developers don’t have to wait for OPS, DBA, etc. anymore!
- Scalable & HA – FaaS providers like Google, Amazon, and Microsoft are scaling much better than anyone else.
FaaS disadvantages
- Latency – It’s not a good idea to use FaaS for Fintech high-performance applications since FaaS will add more latency.
- Limits – Execution time is 300s on AWS and 500s on Google, while memory on AWS is 1500MB.
- No local data storage – For most of your data this is a good thing. Your application needs to be stateless nevertheless, and that can be a serious limitation.
- Debugging and monitoring – There are growing solutions for the issue on how to debug or test locally and offline, but it’s still not perfected. The guys at Dashbird are busting their butts to make this segment amazing! Checkout their awesome new AWS Lambda monitoring
- There are always risks when using new technologies. Lousy stability and frameworks, lack of tools, libraries and so on.
- Vendor lock-in – If anything happens to your FaaS providers, maybe the company shuts down or even goes bankrupt, you will have a severe problem.
Like any other technology out there, serverless has it’s pros and cons and it’s up to us, the developers to figure out if its the right solution for our next project.
FaaS Use Cases
FaaS can be extremely useful in diverse scenarios ranging from hobbyist-level IoT to enterprise web applications. In theory, the use cases for FaaS are limitless, but there are a number of existing trends in development that lend themselves well to serverless functions. As mentioned, Microservices-based apps are a natural fit to make use of FaaS, since an application can be entirely composed of functions that intercommunicate and exchange information on-the-fly.
Some common use cases are listed below:
- Intelligent handling of events in a real-time data stream or message queue. For example, a large-scale IoT deployment where client-side logic is limited can make use of functions to provide event-based functionality that doesn’t weigh on the devices themselves.
- Routing and in-flight manipulation of messages in a Pub/Sub or similar messaging system. For example, building a complex network of publisher-subscriber relationships becomes easy with functions.
- Extending a monolithic application with separate functions to take care of high volume transactions which can be scaled independently of the monolith.
- Enhancing a simple website or app with dynamic Microservices functionality (e.g. widgets/notifications).
- Handing off compute-intensive tasks (e.g. natural language processing/sentiment analysis/image recognition) to a third-party such as IBM, Altception, or Wolfram Alpha.
- Scheduling once-off tasks for background processing in an automatic, cron-like manner.
- Offloading common or standardized functionality of an app such as authentication to a function, in a Backend-as-a-Service sense.
- Implementing chatbots and adding other AI functionality to an application.
- Applying geolocation and tracking functionality to an application.
- Creating your own ad-hoc webhooks and scripts for any imaginable event.
… And the list could go on. Take a look at PubNub Functions to get a more comprehensive idea of what types of services are available to be run as a function, courtesy of our closest partners. And, of course, where a function doesn’t currently exist to meet your purpose, creating and deploying one is just a few lines of code away.