Breaking Free From Containers

shutterstock_77802670

Many web application frameworks are dropping traditional containers in favor of their own light-weight, embedded servers.  The one I'm most familiar with is Play Framework, but there are others. Why would you want to do this? Many deployment challenges come from [mis]configuration of the container. Often, this devolves into a series of "tickets" bouncing back and forth between the operations team and the development team.  By converting to a "container free" model, more of the system is placed into the (highly managed) development and test lifecycle. If the ops team is managing things manually, it just makes deployment that much easier.  Ideally, the ops team is using something like Puppet, Chef, or CFEngine to manage their environments, in which case this dramatically reduces the complexity.

James Ward wrote an interesting article on applying the "container-free" pattern to a Spring MVC app. Applying this approach to our standard deployment model (using a binary repository such as Artifactory or Nexus) means that our applications now include a LOT more of the dependencies integrated in (and tested with!) the application package itself.

One of the interesting things about James' article is how it makes you really rethink the purpose of a container.  After all, Tomcat is just a few JARs and scripts, right?  Nothing particularly magical there.  Why not just copy those JARs into your project (just like the rest of your dependencies)?  Why bother with stuff like Cargo? The answer, I suspect, is that for a long time now "servers are things sold for real money, libraries are given away."  The more you know, the more hollow this distinction.

The only major thing to sort out for a team considering transitioning to a container free model  is precisely how configuration values are injected.  Depending on the framework, there are a variety of ways, but in the end most boil down to a configuration file. JNDI, XML, JSON, or a more complex key store - whatever works for your platform.  The important thing is that it's managed via a configuration management system.