It has been fourteen years since Google introduced Google App Engine. For the first time, a developer could create a programme and deploy it to Google’s Cloud Platform without worrying about how the server was supplied or whether the operating system needed patching. AWS took notes and launched AWS Lambda a few years later, in 2014. The new model fundamentally changed how we architect, write, deploy and run applications.
Function-as-a-Service (FaaS) is a cloud computing service that allows developers to write and deploy code without worrying about the underlying infrastructure. FaaS is a relatively new concept and is often compared to Platform-as-a-Service (PaaS) or Infrastructure-as-a-Service (IaaS). However, FaaS is unique in that it focuses on providing a serverless environment for code execution. That means developers do not need to provision or manage servers, which can significantly simplify the development cycle. In a nutshell, it’s just another set of abstraction layers on top of the Cloud Providers IaaS & PaaS offerings. No alt text provided for this image
The FaaS model is an excellent option for many applications, especially those requiring short-lived tasks. FaaS is also ideal for applications that require low-to-medium traffic and fast response times.
For example, consider a scenario where your organisation needs to process video files. You could break down this process into a series of microservices or functions. One function could be responsible for extracting metadata, another could transcode the files to a different format, and a third could be responsible for applying a watermark. In this case, providing enough hardware to handle the load would be challenging and costly. However, you could deploy each of these applications as a FaaS function, allowing you to quickly and easily scale up or down as needed.
Some of the advantages are:
One of the main challenges of using a FaaS is deciding on the best architecture for your application. When you are using FaaS, you can’t rely on having control over the servers that your application is running on. That means you need to decide on a more distributed architecture, with your functions communicating with each other over message queues and other services that provide a standard interface between the functions. Therefore, debugging issues is a more tedious because of the distributed architecture. Another challenge is testing your code. When running your functions in a FaaS, you don’t have direct access to the code. That makes it more challenging to write unit tests. When it comes to time-critical projects, you should consider the cold-start and warm-up times.
FaaS implementations are available from a variety of vendors. Each has an extensive ecosystem of complementary services and integrations with other services. AWS Lambda, Azure Functions and Google Cloud Functions are the offerings from the three major cloud providers.
Start by educating yourself and setting a goal to become the subject expert in your organisation. It is also essential to establish a good relationship with your cloud provider. They can guide you through your journey and provide you with additional training materials. Many of them offer predefined workshops that you can follow.
Identify a project that fits the FaaS model. It’s typically a small, greenfield project demonstrating the model’s technological and business advantages. You should always start small and remember that “done is better than perfect”. Once you have implemented your first solution, iterate, learn from your setbacks, and improve.
Each of the three major FaaS platforms offers a different set of programming language runtimes with which functions can be deployed.
Supported Runtimes per FaaS provider
These are the supported “out-of-the-box” runtimes. If you’d like to use an alternative runtime, you can build one as a Docker container.
FaaS will undoubtedly play a significant role in developers’ toolkits. Therefore, it’s essential to understand how FaaS might benefit your business. If your application fits the FaaS model, go for it! It’s an excellent platform for developing, deploying, and running production-grade applications. FaaS is suitable for everyone, whether you are a startup, an SME, or a large organisation, as it provides scalability, flexibility, and lowering the time-to-market at a low cost.