Additionally, the trickle of big name brands embracing microservices is slowly but surely developing into a full blown stream. To deploy and manage those microservices, are containers and serverless computing two technologies that are in competition, or are they complementary? Or, does the former gracefully float developers downstream towards the latter?
As always, we’ve turned to industry experts for insights.
What Are Containers, And How Do They Work?
The term “container” refers to the way an application or microservice is deployed, executed, and scaled in an isolated package. According to Amazon, a leading provider of container environments via AWS, containers are “a method of operating system virtualization that allow you to run an application and its dependencies in resource-isolated processes.” Amazon’s definition continues by explaining that containers allow developers to easily package an application's code, configurations, and dependencies into “easy to use building blocks that deliver environmental consistency, operational efficiency, developer productivity, and version control.”
Docker, a container orchestration platform, also lays out a robust definition of containers, “Multiple containers can run on the same machine and share the OS kernel with other containers, each running as isolated processes in user space. Containers take up less space than VMs (container images are typically tens of MBs in size), can handle more applications and require fewer VMs and Operating systems.”
For an even deeper definition, we turned to Brian Johnson, CEO and co-founder of Arlington, VA.-based DivvyCloud. Johnson explained that containers are “portable applications that are packaged up with all [the] required components [to deploy websites and applications], allowing the application to run on any system without any application-specific dependencies being installed.” He also said that the only requirement for a container to run is the Linux kernel (or emulator). “Containers work by leveraging the Linux kernel's containment features,” Johnson continued. “These features comprise a suite of system calls and tools that can be used to manage and isolate any single process running in [a] userspace. [Thus], you achieve application isolation without the overhead of a VM (Virtual Machine),” he said.
Related Article: What You Need to Know About Containerization
What is Serverless Computing, And How Does It Work?
According to tech giant Amazon, "serverless computing allows you to build and run applications and services without thinking about servers." Serverless architecture infers that the developer doesn’t need to worry about to provisioning, scaling, and managing any servers. “You can build them for nearly any type of application or backend service, and everything required to run and scale your application with high availability is handled for you,” states the Amazon AWS website.
Brian White, Senior Solutions Architect at Winston-Salem, NC.-based Small Footprint, shared his broader definition of serverless computing, “Serverless computing allows developers to run custom code in an environment without worrying about provisioning any servers. Functions are often run in a cloud environment and are billed by the amount of time the process is running instead of how long the server is up. They are often triggered by an event, run for a [set] time, and then become inactive until they are triggered again,” White explained.
Johnson noted that while the term “serverless” might indicate that there are no servers, that’s not necessarily the case. “Serverless computing still requires that the code runs on a server. The [serverless cloud] provider abstracts away the server and essentially runs a developer’s code on a server somewhere in [the cloud provider’s] existing infrastructure and returns the result,” he said. So, the server exists, it’s just that developers never need to interact with it — allowing teams to focus solely on their code.
Containers Versus Serverless, Which is Better?
When asked about the containers versus serverless debate, Johnson mentioned that “containers take a little longer to build and often come with a little more complexity around orchestration and deployment.” However, Johnson noted that, with containers, developers have a lot more control over how the application runs and performs. “Containers are also more portable than serverless functions,” he added.
As for serverless methods, Johnson said they’re usually best suited to very short and small operations such as a single function. “Serverless methods also allow [developers] to access cloud-specific services quickly and efficiently [and allow for] speedy development and deployment,” continued Johnson.
While serverless removes provisioning, deployment, and maintenance, developers do not have direct access to the containers, Johnson continued to explain. In other words, developers trade autonomy for speed and decreased costs. “[Serverless takes developers away from] the inner workings of the system. This approach can make it very difficult to debug issues. For large applications, serverless can lead to code sprawl very quickly, making it hard to manage,” Johnson elaborated.
Josh Eichom, CTO at Phoenix, AR.-based Pagely, also gave his two cents on the debate. “Serverless is generally better when you only want to worry about code, and are willing to be locked into a provider’s platform to get that reduction in effort. Containers are generally better when you need more flexibility,” Eichom said.
Thus, Eichom urged brands to use containers in situations where “you need flexibility, or know you will have high scale.” Otherwise, serverless is the way to go if your main goal is to reduce overall maintenance and you are willing to be locked into the provider's platform.
Related Article: Can Docker and Hadoop Just Get Along?
A Hybrid Approach?
White, on the other hand, doesn’t see why a brand has to choose. Both containers and serverless functions can be used for the same development project but for different purposes as far as he’s concerned. “[Serverless] functions are really good for processing data and other triggered events. They are fast to set up, easy to call, and usually inexpensive since you only pay for the time that the function is running. On the other hand, with containers, you have more control of scalability and resource management through orchestration tools,” White explained.
Chris Ciborowski Docker Captain and CEO of Irvine, Calif.-based Nebulaworks, concurred with White. He mentioned that the best solution depends on the desired degree of control your organization needs, as well as the nature of the applications (code) that are to be executed. “If the developer does not want or need to take the time to determine how their code should be executed, serverless is a good option. Also, if the application that is going to be run is short-lived, say a job based on the result of a series of inputs, functions (what we call serverless applications) make sense,” Ciborowski said, echoing the thoughts of Johnson.
Conversely, if the application runtime dependencies require more control, Ciborowski pointed to containers as the superior method for developing and deploying code. “One is not necessarily better or worse, rather, they should be considered based on the requirements. They can, and certainly, often work side by side application deployments,” he concluded.
Containers — A Stepping Stone to Serverless?
Chad Serino, Head of Sales at Washington DC-based Advanced Cloud Services, gave another perspective worth pondering. He sees serverless to be the end goal for growing brands. “Companies sometimes have to take small steps when [evolving their architecture] from microservices to containers and eventually to serverless. It could be the only way for them to achieve that goal [of going serverless]. It’s an IT migration “journey” not a “containers versus serverless” debate as many would have you believe,” Serino stated.
Interestingly, Serino’s position — that containers may be used as a stepping stone towards serverless computing — was embodied in a real-world example. Ivan Montiel, the Founder and CEO of Clarity Hub recently penned a blog post that explained the company’s journey from microservices within containers to a serverless architecture supported by Amazon AWS Lambda. It’s a detailed but enthralling read, which ends like with the following, “Moving our startup to simple stateless serverless functions has a few hurdles, and AWS Lambda has a few quirks that requires some trial and error. We are still getting used to how AWS Lambda works, but the serverless framework substantially lowered our barrier to entry. Serverless allows us to to focus on delivering business value—while AWS does the undifferentiated heavy lifting.”
What’s your take on serverless computing? Share your thoughts in the comments section below.