The word Serverless plants a seed in our mind without knowing what it actually is. Are you visualizing empty data centers? Does Serverless mean we are abstracting servers from our infrastructure? Of course not. So what is Serverless and what benefit does it provide?
Before answering the Serverless question we need to understand what started the Serverless trend. Amazon announced their Lambda service back in November 2014 which ignited the Serverless buzz. AWS's Lambda is a Functions as a Service (FaaS) or snippets of code designed to run a specific task.
Serverless/FaaS stands out from other solutions with the use of functions. These functions trigger by a defined event. Once the Function has run it terminates waiting for the next event to arrive and start again. Serverless applications run only when requested, unlike traditional VM's/Containers which always run. Wow! Serverless has huge potential to reduce cloud computing costs.
The Google Trend graph indicates Serverless has within the last 6 months started gaining momentum. The Serverless trend is still new and on the upswing of the growth curve. The big players such as Microsoft announced Azure Functions in the summer of 2016. Google also announced the GCE Functions recently released in Alpha. The already mature AWS Lambda has a big jump ahead of the competition and remains the FaaS leader.
Open Source alternatives like IronFunctions and Funker are making incredible advancements. The Open Source projects are trying to abstract the AWS Lambda idea away from vendor lock-in. This will allow us to run FaaS on Docker and any infrastructure we desire. More choices, flexibility, and control. Win/Win.
Serverless Google Trend
Docker and Serverless
I discovered Serverless by way of Docker's Ben Firshman. He presented a Serverless Demo at DockerCon 2016. Ben's demo blew me away and I scrambled to understand the Serverless concept with a sense of urgency. I tried his demo and started researching Serverless and all the concepts surrounding it.
Combining Serverless with Docker is equivalent to discovering fire for the first time. This combination unearths massive potential. Ben Firshman pointed out "some people suggest that Serverless will replace Docker. That's not entirely accurate as Docker is the perfect platform to build Serverless applications."
Now is time for the fine print disclaimer. Docker and Serverless don't run right out of the box. It requires a bit of elbow grease, coffee, and a framework. The Serverless Resource section contains some frameworks available for Docker and additional documentation. The foundation of these frameworks is Docker and Docker Swarm.
Docker == Serverless and that is plain Awesome Sauce!
It Doesn't Fix Everything (Yet)
Docker and Serverless are sailing into uncharted waters. Some functionality is just not available or mature yet. For example, the speed in which containers and the Functions execute could be a bottleneck. Deploying stacks of containers and Functions is also another consideration. Finally, the operational side like logging, monitoring needs to ramp up to support the Serverless approach and understand this new operating model.
None of these points mentioned should be a showstopper. With proper planning and preparation, nothing should catch you off guard. Your particular use case will drive what is actually feasible and not.
The best Serverless reference on the internet which I recommend is the Serverless Architectures. The article authors Martin Fowler & Mike Roberts covered all the aspects of Serverless. This is the best Serverless information on the internet and should be a guide for everyone.
Here are some of the Docker Serverless projects and resources currently available. Please note that most of these projects are less than 6 months old. Ensure your coffee machine is operating at 100% as we will need a constant caffeine flow for the next few weeks.
- Serverless Architectures (Martin Fowler & Mike Roberts) - The complete Guide to Serverless What, How and everything in between
- Awesome Serverless - Curated list of resources related to the Serverless project
- IronFunctions - The serverless microservices platform powered by Docker
- Docker Lambda - Docker images and test runners that replicate the live AWS Lambda environment
- Docker faas - Docker Functions as a Service provisioned with one command onto a Docker Swarm
- Serverless Docker Voting App - This is the famous real-time voting app that Bret Fisher demoed in the above video.
- Funker - Functions as Docker containers by Docker's Bret Fisher
- go-dexec - Go Library to run processes inside Docker containers as if you are running them locally
If you liked this article be sure to Follow Me on Twitter to stay updated!