Docker and Serverless? Buzzword Stew!

A DockerCon Demo Claimed Docker Is a Serverless Platform

Posted by Ryan S. Brown on Wed, Jun 22, 2016
In General
Tags: dockercon, docker, faas

Yesterday at DockerCon, Ben Firshman gave a demo of building “serverless” applications on Docker and published this blog post. Just before that, I’d published this post comparing Kubernetes and Serverless, since I was asked about it on Software Engineering Daily. In Ben’s post, he claims Docker is serverless. Before we start in on that, let’s review what “serverless architecture” means.

  1. Reducing maintenance by not running your own platform
  2. Using third-party services wherever possible to reduce the amount of code you’re responsible for to only what’s truly specific to your business (servicefull).
  3. Using Function-as-a-Service or nanocompute for the custom code you do need. That way, you only pay when users are actually getting value, minimizing your persistent infra needs.

The demo used was a voting application with parts written in Perl, Python, and Java that all run on-demand in Docker Swarm. Let’s see how this stacks up as “serverless.”

Serverless Docker?

First, a direct quote from the post about serverless vs. Docker:

But serverless doesn’t mean there is no Docker – in fact, Docker is serverless. You can use Docker to containerize these functions, then run them on-demand on a Swarm. Serverless is a technique for building distributed apps and Docker is the perfect platform for building them on.

Well, serverless isn’t really a technique for building distributed apps - it’s about building useful apps, that are often distributed. That aside, containers are not serverless. Containers are a platform, and if they’re provided as a service they fall more into the PaaS bucket. If they’re provided in a way similar to AWS Lambda, where they’re used to process inputs and provide granular, metered compute as a Function-as-a-Service, then they’re FaaS, not serverless.

Using Docker, it is possible to build a Function-as-a-Service platform, which seems to be what Ben did in his example. It uses Docker Swarm to invoke a container with custom arguments. In the demo, a new container is created for every function invocation which would introduce latency that wouldn’t really be acceptable for most user-facing systems.

Even as a FaaS, Docker/Swarm don’t meet all the requirements: there isn’t a fast, automated way to add and remove capacity on the fly. Adding nodes to Swarm requires either Docker-machine or manual intervention. Without capacity scaling, you don’t get the third advantage of serverless. You have to pay for the capacity full time either way, so there’s not really a benefit to this FaaS-on-Swarm compared to running persistent containers on Swarm.

Wrapping Up

And now, the final scorecard. Does Docker…:

  1. …reduce maintenance by not running your own platform? (nope)
  2. …help you be servicefull by using more third-party services? (nope)
  3. …provide Function-as-a-Service/nanocompute for the custom code you do need (also nope!)

So, no. Docker isn’t serverless. Docker could, in theory, be used to build a platform to run serverless applications on, but that doesn’t make it serverless. Docker does do a fine job of making containers user-friendly, and that works for infrastructure and for making applications easier to run and schedule (especially with a little help from Kubernetes).

Keep up with future posts via RSS. If you have suggestions, questions, or comments feel free to email me, ryan@serverlesscode.com .


Tweet this, send to Hackernews, or post on Reddit