Function or Functions as a Service (FaaS) is a hot topic in the world of software architecture. It’s a market forecast to reach $31.53 billion by 2026. FaaS has been gaining lots of attention from the developer community, in particular as one of the fastest-growing cloud delivery models. It’s already changing the way technology is purchased, as well as how it’s being delivered and operated.
Global uptake of Function as a Service (FaaS) by sector:
FaaS could have a significant impact on businesses going forward, since users don’t have to pay for server redundancy but just for the amount of computing power an application uses per millisecond. Instead of having entire applications on servers, businesses can run them from the cloud. According to Gartner, having this kind of event-sourced, real-time awareness will be on the priority list for 80% of digital business solutions going forward.
What is FaaS?
Hosting software applications on the internet usually means provisioning and managing virtual or physical servers, along with operating systems and web server processes. With FaaS, all physical hardware, virtual machine operating systems, and web server software are managed automatically by the cloud provider. Instead of having an application on a server, businesses can run it directly from the cloud.
Examples of FaaS providers include:
- IBM Cloud Functions
- Microsoft Azure Functions (open source)
- AWS Lambda, by Amazon
- Google Cloud Functions
- OpenFaaS (open-source)
The difference between FaaS and Serverless
FaaS is not the same as, but is a subset of ‘Serverless and Functions as a Service’. Serverless computing focuses on a particular service category, e.g. database, messaging, APIs, or storage – where the management, configuration, and billing of servers are invisible to end users. FaaS, however, is one of the most central serverless architecture technologies. It is focused on event-driven computing paradigms involving entire application codes only being run in response to requests.
Benefits of FaaS
FaaS is the ideal tool for companies looking to move their applications efficiently and cost-effectively to the cloud. Some of these benefits include:
- Being able to focus on code rather than infrastructure. Instead of scaling a monolithic server to handle the potential load, FaaS divides servers into functions so they can be scaled automatically into microservices without the need to independently manage infrastructure. In that way, developers can focus on app coding and reduce the time to market significantly. This can be extremely beneficial to a startup company.
Below is an example of all the code required to deploy a fully scalable, usable business logic function to the cloud:
Other ecosystems use at least some idle capacity. FaaS is also the only model with resource limits on code size, memory, run length, and concurrent activations.
- FaaS offers users the ability to scale automatically, instantaneously, and independently whenever required. As demand decreases, FaaS technology can scale down immediately. With FaaS, each action is instantly and inherently scaled. Other models also offer scaling that’s automatic, but these are slower, with scaling needing to be carefully tuned using auto-scaling rules.
- FaaS offers the many benefits of a robust cloud infrastructure – it has a built-in high availability spread across multiple availability zones in each given geographic location. FaaS can therefore be deployed multi-regionally without any additional costs.
- FaaS runtime is extremely fast and takes milliseconds. For those used to the minutes or hours other systems take to run, this speed doesn’t compute. But FaaS is charged at a granular level and billed by the millisecond at blocks of 100, rather than by the hour or minute, as is the case with other models.
- There is no ongoing administration for FaaS, compared to the easy-to-hard sliding scale of PaaS, containers, or VMs.
- No capacity planning is required. Unlike other models, FaaS requires no capacity planning.
- No maintenance is required. Workflow maintenance is carried out by FaaS providers like AWS Lambdas. This is also the case for PaaS, however, containers and VMs need significant ongoing maintenance – including the updating and management of operating systems, connections, and container images – amongst other tasks.
- It has high availability and disaster recovery. High availability is inherent in a FaaS setup at no extra cost of effort. Other models require extra management and cost implications.
Challenges of FaaS
Not every business will be right for FaaS, even though it offers the potential of taking away the unwanted compute automation associated with idle server storage and infrastructure – and helps to keep costs down.
Things to consider before committing to a FaaS model include:
- With less responsibility comes less control. When it comes to security, FaaS may not work as well for some organisations. There can also be problems monitoring function apps in terms of how often they occur, the time they take, and in understanding the reasons why they might be slow. Since users don’t have servers to control or the ability to manage the resources on it there’s no possibility of installing monitoring software.
- FaaS could open up security issues, including malicious hacking and data leakage. If elements such as Google Cloud functions are running on a multi-tenancy server, users could access each other’s sensitive data.
- FaaS means signing up to vendor lock-in and it won’t be easy to move these services from one cloud to another. Every cloud provider approaches FaaS differently – whether public cloud or open source. However, it’s not possible to take a function and move it between cloud FaaS providers. Signing up to a long-term vendor introduces the risk of committing to a cloud that doesn’t offer the features end users may require in the future to deliver business value.
- Creating the right ecosystem for a new breed of serverless-computing IT engineers is challenging. Serverless architectures require CIOs to reduce the amount of governance around technical delivery in order to facilitate digital transformation.
- With FaaS there’s less transparency around backend infrastructure. With a pay-per-use model, it’s hard to incorporate FaaS into budgets.
How does FaaS work?
FaaS enables developers to run web applications in response to events without having to manage servers. As it’s an event-driven model, it’s there when needed but doesn’t require server processes to be running constantly in the background as with platform-as-a-service.
Entire applications are composed of a mix of functions, microservices, and long-running services. Providers make a function available via an Application Programming Interface (API). The provider also manages resource allocation. Since functions are event-driven, not resource-driven, they’re easy to scale and this allows for greater functionality, flexibility, efficiency, and value.
Functions start in milliseconds to process requests and if there are several requests for a function at the same time the system creates the appropriate copies of the function as required to meet demand. It’s possible to build an entirely serverless application using FaaS – or one made up of a partially serverless and partly traditional microservice model – to take advantage of the latest technology provided by orchestration systems, e.g.’ Kubernetes.
Kubernetes is an open source container orchestration tool critical to the management of cloud-computing functionalities. Kubernetes functions include security, logging, monitoring, and authorisation.
FaaS use cases
FaaS is especially good for high volume parallel workloads – as well as for the creation of back-end systems and for data processing, encoding, format conversion, and data aggregation.
It is also highly suitable as a tool for back-ends, data-processing, web apps, or to create chatbots for IoT devices. FaaS is useful in helping to manage and oversee third-party services too.
FaaS for Android app development
When it comes to Android app development it’s possible to keep costs down using FaaS since users are only charged when an app connects to the cloud for specific functions, e.g. batch processing. This makes for a far more cost-effective approach than a traditional method.
IBM Cloud Functions used to forecast the stock market
FaaS is also an invaluable way to boost computing performance. In a recent use case, FaaS helped IBM engineers use IBM Cloud Functions for Monte Carlo simulations to estimate the future outcomes of (estimate) stock prices.
Monte Carlo simulations are mathematical methods used to estimate the future outcomes of hard-to-predict events. From weather forecasting to complex financial forecasting, this method uses random sampling based on input data to estimate future data outcomes for a model. The larger the sampling the more accurate the range and the better the estimation.
IBM Cloud Functions provides a fast way to run predictive analysis
IBM Cloud Functions is a serverless FaaS that was used to complete a Monte Carlo simulation for stock prices in just 90 seconds – that’s compared to the 247 minutes it usually takes when run over a laptop with 4 CPU cores. Python code was used to process a number of forecasts to predict stock prices over several days. The next step was to run the same code on a massive scale to process over 100,000 forecasts collected over 1095 days.
This scale of operation couldn’t be achieved using cloud-based VMs. Instead of running computations locally, IBM Cloud Functions for Monte Carlo was used to run them at a massive scale. Using PyWren IBM Cloud Framework, users were able to focus on the code while the framework focused on execution in the cloud. Once forecasts were complete, a single ‘combiner’ was used to aggregate results and generate a graph with the predictions.
The IBM PyWren-IBM Cloud enabled this to be done using only two lines of additional code.
Explore RingCentral cloud-based communication solutions for business
RingCentral’s unified communications as a service (UCaaS) offering can help improve the efficiency and productivity of a company’s entire communications system. Just as FaaS removes the burden of having to manage servers, RingCentral’s solution saves time and money. With a unified communications system in place, all comms are brought under one umbrella so that employees no longer have to continuously switch between devices and channels in order to collaborate.
Communication also takes place in real-time – like FaaS, RingCentral’s software is provided as a service, so users need only pay for what they use.
Ideal for busy SMEs to improve efficiencies, a single, affordable UCaaS solution helps companies to grow and scale their cloud native apps, also ensuring they provide the highest quality of customer service independent of geography or channel.
Just as serverless architectures look like being the future of cloud computing, RingCentral is set to become the future of business communications – but delivered today.
FaaS offers greater scalability, increased flexibility, and a faster time to release – all at a reduced cost. Just as RingCentral is ideal for SMEs and start-ups to enable them to scale communications, FaaS is useful for smaller businesses in enabling them to concentrate on building products rather than managing servers. That’s why many developers favour FaaS and solutions like Microsoft Azure and Docker, predicting that they will be the future of cloud computing services.
Originally published Mar 10, 2021, updated May 28, 2021