Serverless and containers are both software architecture design choices, which causes a common misconception that it is either one or the other, according to Chris Parlette, director of cloud solutions for the cloud services company ParkMyCloud.

“A lot of people put serverless against containers, but there is room for both,” he said. There are three main ways to set up your architecture when it comes to the cloud. First, there is a traditional server approach where you run a virtual machine. Then there is the container approach where you have isolated environments in which you run individual applications or individual services. And then the third model is serverless, where you have hosted database services running for you instead of having to install them yourself. Parlette explained that you don’t have to just pick one of the three, but there can be a mix and match.

In fact, Tolga Tarhan, CTO at, cloud-native services company Onica, believes a full cloud-native story involves both serverless and containers working together. “Serverless is often a major component in how we define cloud native. The main definition we are going for is leveraging the higher value, more managed services from the cloud vendor as opposed to leveraging just virtual machines in the cloud,” he said. “Containers and serverless together can address just about every use case moving to the cloud today, but either one by themselves isn’t the whole story,” he said. 

For instance, if you have an existing microservices architecture, it makes more sense to keep those services on containers. However, if you are building new microservices, you can start to move to a serverless approach, he explained. Additionally, Tarhan said you can split your microservices into both containers and serverless architecture. “Let’s say you have 20 microservices and three don’t fit serverless very well, then you can use containers for those three and do serverless for the other 17,” he said.

Serverless works very well in small discrete tasks, or large applications that are made up of small discrete parts, according to Cloudflare’s CTO John Graham-Cumming. Where containers come in is if there are more complex requirements, access to a lot of data or developers are writing in a language that serverless platforms don’t support yet.

Then the challenge becomes having  to manage both types of environments and knowing how to deploy, adhere, maintain and scale both. “I don’t think that is an unreasonable tall order, but it is added complexity to mix and match,” said Tarhan . 

Areas where serverless might not make more sense over containers include portability between cloud providers, hybrid cloud solutions, and legacy systems with long running connections.

“There are still going to be classes of applications where you want more control, and there is also value to be had in more de facto standard for operationalizing code in a cluster,” said Viktor Klang, deputy chief technology officer for the cloud-native company Lightbend.