Making the Case for Functions as a Service (FaaS)
You may have noticed Webapper’s growing enthusiasm for cloud native application development. Over the past year, we’ve posted about serverless computing, microservices, and modern application development. We’re increasingly moving our business in this direction, leaving monoliths behind in a hasty migration to design patterns like Functions as a Service (FaaS). In Functions as a Service architecture, all features of an application are deployed and hosted as individual, solo features. As a result, FaaS is a dynamic, fluid, cost-optimized model for application development.
To set the stage, we’re building applications using serverless computing on AWS. With Lambdas, we directly run our code without managing any servers. Lambda services are “pay as we use,” which allows us to scale applications by running the code whenever someone requests our Lambdas. Serverless computing offers numerous advantages for application migration or new cloud development project. Our developers don’t have to get into the server-side anymore, instead focusing on coding the application functions.
FaaS Systems Are Easier to Understand
Systems are easier to understand since coding the application is based on single functions. The functions themselves are less complicated because they are smaller, discrete, and distributed. Most importantly, a developer can work on a function without having to know how the whole system works. The result is that developers can become more productive, even in the beginning.
Cost Management – Pay for What You Use
You may recall that serverless computing delegates infrastructure management (provisioning, configuration, and management) to a third party (e.g., Amazon, Microsoft, or Google). With FaaS, you only pay for server functions when you use them. Thus, it saves money since you do not pay for server when not in use. No need for long-term reservations…
The Platform Manages Horizontal Scaling
With serverless computing, the burden for adding more machines to your pool of resources (also described as “scaling out”) does not fall on you. Capacity is added as needed by the workloads supplied. If you’re using AWS, Amazon handles your scaling for you.
Freedom of Choice for Development Languages
Simplify & Streamline Application Updates
Since there’s no infrastructure to manage, the rollout of new functions and updates is seamless. That is, you don’t have to orchestrate “enterprise upgrades” since there are no servers.
The Case for Functions as a Service
The advantages of FaaS are obvious to us: easier development cycles, lower infrastructure costs, and improved service (uptime, performance).
The one issue we’ve had to overcome is “cold starts” — when there is no server already running, initialization can lag. In the background, FaaS uses containers to encapsulate and execute functions. When a user first invokes a function, FaaS keeps the container running for a limited time — if another request comes in before the shutdown, the request is served instantaneously. Note, FaaS is not suitable for all workloads. FaaS can address the needs of event-driven functions, but containers can better suit some workloads. To address our particular situation, we found a workaround to keep the function alive (typically in off-peak times) to eliminate the lag.
Serverless applications are growing in popularity, so the downside issues raised during early adoption should dissipate over time. Meanwhile, we’ll continue building systems with FaaS and share our experience.