Why Virtualization is cool

When developing some application or website, I cannot stress how much it helps to use virtualization. It may seem like an overcomplication, but having an exact (or nearly exact) replica of the production environment helps immensely.

For instance, when developing my mafioso game, I found a problem where on the Hackintosh that I’m developing on, Macports uses version 2.0 of MongoDB. When I deployed on my Debian 6 server, I found that the version of Mongo installed was 1.4! If I had been using a virtualization of Debian 6, I would have seen that I was developing on a version of MongoDB that was not available in my target¬†environment.

Going back to real life experience, at my current company I created a VMWare instance of our production environment. I copied the production memcache, php, apache, freetds and other configs that we use in production onto our image. Then, you can be sure that the features that you’re using, and the errors you’re experiencing can will be the same as production. If you need to install a new package in order to use some certain functionality in PHP or likewise, you will need to note that it’s a requirement for deploying the feature being developed.

Virtualization also gives you an environment that is separated from your desktop. All the crazy things that you might do in your desktop are isolated from the environment of your virtualized server. What you see in the virtualization is what you should see in production.

Also, you can upgrade that virtualized image to a new OS to test the upgrades to your applications that will need to be performed when the upgrade happens when the upgrade happens in production. Virtualization helps you isolate changes to a specific environment change.

Lastly, virtualization is sharable. The configuration you have done on your local development environment is local to your desktop. When you include virtualization, you can just copy the image to the other developer’s desktops.

If the source code is loaded by a share or an NFS¬†partition, then the only thing that can be different between production and development is that loading of the source code itself. Which will lead into the next topics… Deployments and builds.

One other very important part of virtualization is this. If you develop on OSX (or some other environment), then you still want to see whatever x% of people see. In this case, you install Windows XP, Vista and 7+ in a virtual machine. Load that machine up, and check out IE 6,7,8,9 plus whatever differences there are in Firefox and Chrome on Windows, and see the issues immediately. If you develop this discipline, then you will see issues that people stuck on these operating systems will see before they become an issue.

This entry was posted in Lessons learned. Bookmark the permalink.

Comments are closed.