“All happy Serverless implementations are alike; each unhappy implementation is unhappy in its own way.” – Paraphrased from Leo Tolstoy (In “Anna Karenina”)
Over the last year, along with Kubernetes, Serverless computing platforms have acquired tremendous mindshare among the development community. As Serverless implementations begin to proliferate, old norms of software development are being discarded but yet some fundamental truths still matter.
The characteristics of “Tech Debt Free” Serverless architectures include the following.
#1 No Infrastructure to Manage, Period –
This is the basic idea of Serverless but is still the fundamental tenet here. Infrastructure in this definition includes everything outside the core business logic itself – Physical Hardware, Operating Systems, Virtualization stacks, Container orchestration, Build, Deployment, Automation & Config Management tools etc. Leading serverless frameworks such as Platform9’s Fission platform even abstract away their underlying foundation Kubernetes. Developers should only focus on the actual business logic and delegate all of the infrastructure considerations to the infrastructure/cloud provider. This is a key differentiator for the Serverless model as compared to a PaaS.
#2 Loosely Coupled Application Architecture –
The best use of functions is to perform targeted business tasks that are triggered based on Events. Thus, functions in their purest form are both stateless and ephemeral in nature. They should execute quickly, store no data in between invocations & should be amenable to being pulled down once they finish executing. While they may store/update data as a result of their execution, by itself the function stores no state. The time to execute is a critical metric as functions are metered and charged by cloud providers on a “time to execute” model. Long-running functions are cost prohibitive and typically go against best practice. Workloads such as high-performance computing and big data processing are typically bad use cases for Functions.
#3 They Scale Horizontally –
This is kind of stating the obvious but well-designed functions architectures are thus inherently scalable without any operator involvement. The illusion of infinite yet elastic capacity in Serverless applications is provided by the IaaS layer. Functions build on this by being able to be started and run on new containers as demand spikes. Using higher order concepts such as Workflows, individual functions can be chained together to perform complex business actions. And again, these functions can be orchestrated together to scale every task as required in realtime.
#4 Flexible and Change Native –
Robust function architectures support change as a native construct. Functions should be easily testable locally, support canary & rolling deployments. Each function is easily and independently updatable. In this aspect, functions are microservices on steroids.
#5 Deployable Everywhere – Edge/Stream or Data Center-
Thanks to the versatility, power, and flexibility of containers – Cloud Native Architectures are now deployed in business scenarios that were previously unthinkable. This includes three specific areas – at the Edge (where customer interaction, or, device interaction takes place), in Transit ( as the data stream flows into the backend application) and in the data center. While complex Data Science models are not a good fit to be encapsulated in functions, functions can still perform a range of tasks such as transformation, normalization, and simple computational tasks. The same benefits seen at the core with Serverless (low TCO, Increased Operational Efficiency, Efficient Developer Experience) are also valid at the Edge.
Conclusion…
Serverless platforms are still in a relative stage of infancy. They can confuse developers who have worked on legacy platforms or monolithic architectures. However, the benefits in terms of operational ease of use and agility far outweigh the complexities incurred in their design and deployment.