$ cat post/the-rollback-succeeded-/-the-secret-was-in-the-env-/-the-patch-is-still-live.md
the rollback succeeded / the secret was in the env / the patch is still live
Title: Docker Containers vs. VMs: A Closer Look
September 7, 2015 was a day like any other in the world of ops and infrastructure—except for one thing: I was wrestling with yet another decision about how to best utilize our resources. The choice between Virtual Machines (VMs) and Docker containers had been on my mind for months. As someone who has spent countless nights debugging both, it’s a topic that doesn’t come without its share of drama.
A Bit of Background
I’ve been working in ops since the early days of cloud computing. We started with bare metal servers, then moved to VMs for isolation and flexibility. However, as our needs grew more complex, so did the number of servers and configurations we needed to manage. This led us down the path of containerization.
When Docker first came out in 2013, it was like a breath of fresh air. The promise of lightweight, portable containers seemed too good to be true. But as with any new technology, there were growing pains. In those early days, Docker wasn’t just about creating isolated environments; it was about figuring out how to use them effectively in production.
The VM vs. Container Debate
One of the biggest arguments we had internally revolved around when to use what. The conventional wisdom said that for complex applications with many dependencies, VMs were the way to go. They offered full isolation and easy management, making sense for our core business services. But as we started building microservices and single-purpose apps, Docker containers began to look more appealing.
Our Experiment
To settle this debate, my team and I decided to run a small experiment: we’d build an application stack entirely on Docker containers and see if it could handle the load. We chose a simple web application with a database backend. Our goal was to compare the resource utilization between running it in VMs versus containers.
We started by provisioning our servers, setting up both environments, and then deploying the app. The first thing we noticed was how much lighter Docker containers were on our resources. For similar performance, containerized applications consumed about 40% less CPU and memory than their VM counterparts. This was a clear win for us in terms of cost efficiency.
But here’s where it got tricky: managing those containers. We found that while Docker made application deployment easier and faster, the orchestration part wasn’t as straightforward. Managing stateful services like databases within Docker containers required careful consideration to avoid data loss during restarts or upgrades.
Learning Curves
One of the biggest lessons we learned was how critical it is to have robust orchestration tools in place. At the time, there were a few options out there, but nothing quite as mature and battle-tested as Kubernetes, which was announced by Google just last year. We toyed with Marathon from Mesosphere for a bit, but ultimately found ourselves looking at Kubernetes.
Kubernetes promised a way to manage stateful services more effectively, scale automatically, and handle failures gracefully—all things we desperately needed. But setting it up required a steep learning curve. The documentation was still in its early stages, and there were no clear best practices yet.
The Future is Now
As I write this, the Docker vs. VM debate feels like yesterday’s news. Today, Kubernetes is becoming the go-to solution for container orchestration. It’s not perfect—far from it—but it addresses many of the pain points we experienced with manual container management.
Looking back, choosing between VMs and containers wasn’t as black and white as we initially thought. Each had its place, and the right choice depended on the specific needs of our applications. What’s clear now is that Docker has changed how we think about deployment and scaling, and Kubernetes is leading us into a future where these tools are even more integral to our infrastructure.
Docker containers have been a game-changer for us, but they’re just one piece of the puzzle. The path forward involves embracing orchestration tools like Kubernetes and continuously adapting as new technologies emerge. It’s a journey I’m excited to be on, and it only gets more interesting from here.