3 Types of Infrastructure Elasticity
Here is a list of three major types of elasticity that I have implemented / experienced so far:
- Horizontal : by adding or removing service instances in response to certain amounts of load. Like a load balancer, and behind the load balancer there are multiple webservers. The number of webservers are dictated by number of requests / second: ELB, haproxy, apache mod_proxy, pound, squid, etc. are examples of load balancers, while nginx, Tomcat, Jetty, Apache, thin, mongrel, etc. are just a few examples of webservers.
- Vertical : by adding or removing CPU/RAM in an individual server itself. For example, changing instance the types of an EC2 instance, changing Cgroup settings of an LXC, or changing UBC params of openVZ containers.
- Multi-environment infrastructure : These servers are elastic, as they can belong to different environments at different times. They have the ability to reconfigure themselves against a particular environment. I am trying to improve upon this currently. I am trying to make certain EC2 instances dynamically configurable aginst many different environments. I have modeled my environments and service configurations using Chef. I will configure a server for unit testing jobs (like git clone, rake, spec, etc), and I will configure a server for functional testing jobs (xvfb, x11vnc, firefox, cucumber etc).
- chef-client --once -E unit_testing
- chef-client --once -E functional_testing
Since the functional testing is generally triggered after unit testing (and they also take more time) it's ok for me to run them sequentially one after another. But these really enable two different sets of essential services when needed. Thus reutilizing our infrastructure a bit more. Similar transitions should also be possible across UAT, staging, pre-production, and the ease of tranisition indicates the delta of intigration points.