Rafael Corrêa Gomes

(Serverless or Docker) Which host to choose?

Docker vs Serverless

I see many developers struggling to decide between using serverless or not within an MVP. The first thing to analyze is if your new project doesn’t have hosting limits. As I ever say, it’s essential to understand the trade-offs you might have. Be aware of the exchanges, and you will know what answers you need to decide between possible solutions.

Serverless, Containers, Virtual Machines and Servers with each respective time to deploy.

Serverless

Having the chance to use serverless, I recommend trying it first. It will reduce the complexity to launch your projects; the trade-off here is flexibility. It is harder to replicate the backend in a local environment to test serverless web applications. It’s essential to consider the point that your application might be prepared for the environment. Using containers, you would create an environment with your application requirements.

Cloudflare Workers Serverless
Cloudflare Workers

Containers

Compared with serverless, deploying containers run the same no matter where they are, which means more precise local tests. During the Shopify App development, I missed a clear container to work and deploy to production, that’s when I applied Containers to my Shopify development workflow.

I usually use a Docker container for applications that aren’t as simple as a microservice. A container allows you to deploy to production and have the same container running in your local environment.

Shopify Hydrogen running on Digital Ocean with Docker
Shopify Hydrogen Docker

Probably you know that there are invisible points with containers such as maintainability, security, load balance and other things that you need to monitor and maintain. In more complex structures it’s required, but it’s essential to have in mind that you might have even more points to take care of if you use a VM or Server.

There are many good points to start using containers; my favourite is the control and freedom to switch to any server with the same infrastructure. In my Shopify Hydrogen Course development, we hosted the same theme on Docker container using DigitalOcean and serverless, if you want to check it out.

Virtual Machine and Servers

I didn’t have to go through these two kinds of setups during the course development, but I faced situations that required these kinds of implementations. Before containers were popular, serverless even exist.

About me

Rafael Corrêa Gomes

Rafael Corrêa Gomes

Senior ecommerce developer and architect based in Montreal, Canada. With experience with saas, product and team management using Magento, Shopify, PHP, JavaScript and NodeJS.