Serverless Computing: Hot or Not?
There has been a remarkable increase in serverless computing platforms over the past few years. While few production-ready solutions have been released, the ecosystem has nonetheless matured substantially. You may even have some immediate use cases in your environment or pipeline to consider for a serverless deployment.
Serverless architecture allows web application logic to be processed independently of physical servers, virtual machines, containers, or operating systems. It frees the entity owning the computing system from the obligation to purchase, rent, or obtain servers or virtual machines for the back-end code to run on. Only the processes and code are implicated, and the functions needed from a provider can be selected, mixed, and matched accordingly. Its applications depend primarily on BaaS (Backend as a Service) or on FaaS (Function as a Service). BaaS refers to API providers and services that can be either in-house or external while FaaS can be described as custom code, tailored to suit any need. Serverless allows you to deploy code and utilize resources in a similar way to which you would deploy a PaaS (Platform as a Service) database, load balancer, or any other PaaS service. Software development is made easier by this flexibility as well as by the space created by the undifferentiated server-side logic and state managed by cloud providers. Serverless computing resources are dynamically scaled to meet actual consumption requirements without the user’s involvement or concern towards physical servers, virtual machines, or containers. The diagram below illustrates the respective responsibility involved.
Different forms of PaaS will offer varying levels of flexibility in infrastructure. As a remote example of specialized PaaS, BaaS (Backend-as-a-Service) originally grew popular with mobile application developers and, more recently, with web developers seeking a packaged backend cloud service providing essential functions such as data storage, push notification services, user state, and integration with social media. These services can be reused as a microservice in most types of client-server applications. BaaS has become commonplace, even outside mobile development, with the recent emergence of SPAs (single-page applications) and related architectures. Its architecture resembles mobile, but targets desktops, emails, and browsers.
As a form of PaaS, BaaS could be better understood within the context of mobile applications than serverless architecture, which can better be explained as FaaS (Function(s)-as-a-Service). With FaaS, one can develop, run, and maintain certain specific application functionalities in the cloud while reducing dependency on platform services management, system management, scaling policies, and other traditional administrative and DevOps responsibilities. While BaaS provides a well-defined set of rules and inputs with known responses, FaaS gives you the means to tie anything you choose together, including BaaS for example. FaaS is perhaps the equivalent of a buffet-style restaurant, while PaaS offers a fixed menu. FaaS allows the full extent of flexibility suggested by serverless architecture.
When to Use Serverless Architecture?
- Serverless architecture is the ideal solution for unpredictable usage patterns that require unexpected scaling of short, single-event transactions. In particular, usages with seasonal and episodic applications, such as support for ad-serving scripts and incoming data processing from IoT (Internet of Things) sensors of user-driven content submission, can benefit most from serverless architecture that responds almost instantly to serve memory and CPU requests even though the application had been sitting idle.
- Discrete units of work such as event-driven computing, incoming IOT data, kafka streams or event queues, work queues such as SQS or rabbitmq, or any other type of asynchronous workload can benefit from serverless architecture to process this information as a type of scalable ETL (extract, transform, load).
- Serverless code and libraries can be executed on the cloud without the need to allocate any compute capacity in advance. This facilitates on-demand, just-in-time, and as needed resource allocation. Functions requested simultaneously can be scaled to meet capacity on a request-by-request or work unit-by-work unit basis.
- An application’s time-to-market delivery is expedited by serverless architecture allowing developers to focus on code and processes rather than non-differentiated components and overhead.This almost completely removes the need to manage traditional resources. Removing the orchestration and management overhead will accelerate your development pace in the long run.
What are the Main Drawbacks of Serverless Computing?
- Serverless architecture can cause vendor lock-in due to the lack of ease with which code can be ported between cloud providers or made to be natively multi-cloud.
- It can lead to ‘multi-lock-in’, a state whereby your applications are composed from multiple functions from different providers. While this can give you best-of-breed, it can also lead to bigger challenges than merely being locked into one cloud provider.
- ‘Rolling your own’ serverless architecture using open-source projects, such as OpenWhisk, adds additional cost or operational overhead as well as technological complexities. While allowing you to build a serverless architecture on your own terms, a DIY approach may not be straightforward.
- Serverless architecture is more expensive and less effective for long-running applications that use a steady consumption of resources. It is designed to be efficient and optimized for small, quickly executed requests and units of work.
- As serverless computing is still in its infancy, debugging, monitoring, CI/CD deployment processes, and traditional design patterns may pose challenges, especially in complex multi-tier systems with dozens or hundreds of functions.
- Given that serverless computing services are relatively new in the space, they may have risk factors that are, as of yet, unknown or easily accounted for.
While the name ‘serverless’ may be somewhat ironic since servers are obviously involved, serverless computing is nonetheless exciting as it allows one to break down the code and simplify the complexity of non-monolithic applications. It offers a cloud computing environment with near-instant resources allocated based on usage. It reduces time-to-market by handling the orchestration overhead and, when used for the correct use cases, may provide remarkable cost savings. Serverless architecture perhaps provides the purest form of cloud computing enabling customers to get exactly what they need when needed. If you have any questions or would like one of our experts to perform an architecture assessment, please do not hesitate to contact us.
Donald is a technologically promiscuous janitor (aka Solutions Architect) with an overactive interest in data, practical technology applications, and their effects on human behaviour and interactions as they continue to change due to new technologies and communication mediums. Donald has worked on projects ranging from performance analysis, application assessments, data analysis, and architectural design, and has explained the ins and outs of various technologies to clients.