Jason Horman

VirtualBox for dev teams

At Springpad the development team has spent a lot of time setting up our local environments. The setup includes:

  • MySQL for Quartz job scheduling and random other lookups
  • Liquibase for creating and updating MySQL schemas
  • Cassandra instances for storing block data
  • SOLR instances for faceting and full text search
  • Zookeeper for atomic counters and distributed locks
  • Memcached
  • Redis (for some new development we are doing)
  • And more…

We documented the ever changing setup. We wrote shell scripts to automate the process. For Python we switched from shell scripts to Fabric. In the end though it still felt cumbersome to get a new environment setup for development.

VirtualBox

We realized just a few months back (we are probably late to the game) that we could setup the entire stack in a VirtualBox instance. Not only that, but we could locally run our services exactly as they run in production, on a Debian distribution. We are now setting developers up with:

  1. VirtualBox running a snapshot of a minimal Debian installation. (This instance runs in about 163MB of memory)
  2. The instance is set to Bridged Adapter network mode so that the machine is directly addressable.
  3. Then we install all of the services listed above, and snapshot again calling this “Initial Springpad”. (This instance runs in about 352MB of memory)
  4. We then can copy this setup to the various development machines.
  5. From there the developer can start the “Initial Springpad” instance and connect to it directly from their local OSX development environment.

Nice Benefits

  1. Fast start/stop: To conserve memory, or at the end of the day, you can simply tell VirtualBox to “Save machine state”. VirtualBox will pause the VM and shutdown. This takes about 5 seconds. When you want to restart development, VirtualBox will unpause the VM, also in about 5 seconds. Contrast that with starting and stopping the 10 or so services we had running on OSX before.
  2. Snapshots: Whenever you feel like it you can take additional snapshots. Before testing that bulk delete operation from Cassandra, take a snapshot. Test, throw the snapshot away and revert to the original instance of Cassandra. Very powerful.
  3. Clean Mac: Using VirtualBox moved all of the configuration, log, and installation files of all of these services out of our personal Mac OSX /usr/local, /var/log, /etc directories. They are now neatly tucked away in the VirtualBox instance.

So I definitely would recommend checking out VirtualBox if you want to simplify your local development environment.