Logo
thumbnail

Simplifying Deployments Using Docker Swarm

For the past decade Kubernetes and OpenShift have dominated the cloud environments and they were both amazing. Complicated...but amazing. With this amazingness came the need for Helm, a package manager that allowed you to take your OCI containers that you built and bundle them up with configurations to deploy software to your Kubernetes cluster. If this sounds like a lot of work, its because it is. I recently have noticed the maturity that Docker's Swarm Mode has reached and started to look into it a bit more and I am very impressed. I want to go over how I plan to use this technology as well as it's benefits and trade-offs compared to technologies like Kubernetes.

Benefits

Scalability

Scalability is Docker Swarms strength. It can scale to any businesses needs, not just businesses that can afford to scale. Docker can have swarm mode enabled at any time on any computer. If you need more compute you can add servers and have them join your swarm to pick up the slack. Each server in the swarm can have many replicas of your software running on it allowing you to scale horizontally and vertically more efficiently.

Portability

While the cloud is really good for businesses that are growing fast, it is not so great when you have stopped growing and need to optimize your website to reduce operating costs. Portability is being able to deploy your code into a cloud or non-cloud environment and Docker is perfect for this. We can deploy our application to AWS when we are growing and then migrate to an on-premises solution later when our business has matured.

Debugging

Debugging applications that are deployed to bare metal is a real pain in the ass. You will often run into situations where your code works on your development machine, but faces issues when deployed to a Linux server. This is because in this situation, the Linux server is the runtime that runs your code. Deploying your application to a Docker runtime removes this layer of complexity and allows you to have a consistent environment to run and debug your code.

Trade-Offs

Docker Requires a Build System

To build a software solution that uses Docker, you will need a build system that will create the images that we deploy to your servers. Not everybody is happy that they need to write code that isn't for the website that you are deploying and as a result some developers don't like build systems. As far I am concerned, the build system is doing work that I don't want to do manually and am completely fine with having one. But I want to give you, the reader, a full and clear picture of why you might not want do undergo this additional work.

Closing Remarks

Considering the value that I receive for the trade-offs, this is worth it to me. The ability to push code and have that code deployed in a mostly automated fashion is really important to me and my clients.