Expanding and contracting
An alternative to the in-place upgrade strategy is the expand and contract strategy. This strategy has become popular of late, thanks to the self-service nature of on-demand infrastructures, such as cloud computing or virtualization pools. The ability to create new servers on-demand from a large pool of available resources means that every deployment of an application can happen on brand new systems. This strategy avoids a host of issues, such as a buildup of cruft on long-running systems, such as the following:
- Configuration files that are no longer managed by Ansible being left behind
- Runaway processes consuming resources in the background
- Changes being made to the server manually by human beings without updating the Ansible playbooks
Starting fresh each time also removes the differences between initial deployment and an upgrade. The same code path can be used, reducing the risk of surprises when upgrading an application...