Serverless

When I hear a term like serverless, my first impulse is to scoff dismissively.  And that's a completely legitimate response from an infrastructure person.  The idea of serverless applications is a marketing device, and not a very good one at that.  But I’m not really the intended audience, developers are, and the point of serverless is that developers no longer have to concern themselves with the underlying infrastructure that is backing their application.  Not that they really did before…

Lambda, lambda, lambda

Serverless applications first started cropping up around Amazon's Lambda offering.  Lambda takes a function written in JavaScript and executes it in a pool of AWS compute, and you get charged only for the time the function is processing.  So you don't have to spin up a VM or a container to provide an environment for your code to run in.  You simply upload your code to Lambda and create triggers for its execution.  For applications that are written using the 12-factor model, this could be a real boon allowing developers the freedom to ignore the operating system environment and focus entirely on getting their code to run.  It's not just AWS that has a function-as-a-service offering (FaaS), Azure has Azure Functions and IBM has OpenWhisk.  The idea is certainly appealing to developers and despite having a terrible marketing term that has already garnered some amusing criticism on Twitter, the movement seems to be gaining traction.

There are some obvious caveats for serverless applications and more than a few lingering questions.  The process of writing your code specifically to run in a FaaS offering leads to lock-in and portability concerns.  If I write it for Lambda, can I port it to Azure Functions or do I have to rewrite the whole thing?  Then there's concerns about startup latency and execution duration, i.e. how long does it take to get a function going, and how long will it persist?  Then there are the security concerns: authenticating requests, using certificates, storing data, encryption at rest and in transit, security of function environments.  All of these items have to be considered and probably supported by some infrastructure technology.

What about us Infrastructure Peeps?

Like I said, FaaS abstracts the infrastructure backend, but that doesn't mean it isn't there.  That is where infrastructure comes into play.  At the moment it appears that most FaaS offerings are leaning on a container-based implementation to provide the compute environment for each function to run.  That container environment in turn needs a host OS for the containers, an orchestration system to provision and destroy containers, a scheduler to determine where and when to run functions, and networking and storage to tie it all together.  Obviously if the FaaS is running in a public cloud, then the infrastructure person is limited in the scope of what they have access to, but let's think about what happens if FaaS really takes off.

Assuming that FaaS - I'm just going to drop serverless now - is a hit with developers and people want to bring it in house, then that will require a platform to run it.  VMware is already working on a container platform with Photon OS and controller in the private cloud space.  Leveraging their new relationship with Pivotal and CloudFoundry they could quickly produce a FaaS on-premise offering.  Then there's the Apache foundation and Mesos, which could be modified to leverage FaaS in addition to container scheduling.  Google has their Cloud Functions offering, which probably uses Kubernetes, which you can deploy locally in OpenStack.  So just because the developer doesn't know anything about the backend, doesn't mean that infrastructure isn't important.

This high level of abstraction actually makes a lot of sense as people work to make infrastructure IT a utility.  The tenants in a building don't need to know how the elevators work, how the plumbing is routed, or where the breaker room is.  They just take the elevator to their floor, plug in their laptop, and get a drink of water.  And behind the scenes, people like me make sure it all "just works".

If you're interest in learning more about FaaS and serverless *groan* check out this article by Mike Roberts and this podcast from Packet Pushers.