Hi all,
I'm trying to determine the best way of deploying new versions of an established web application. In the past, I've done it a couple different ways but this time we're looking to do something a little different/better.
We're using development/staging/production servers. After the development is done and the basic functionality is tested, we run the development code with an upgraded production database on the staging server. If our internal QA doesn't find problems in the staging environment, we make those changes live.
That last step has been done in the following two ways:
Upgrade the code and the database schema at a time of low usage, do a bit of testing to make sure the upgrades went OK, then cross fingers and hope the users don't find some bug that QA missed, always ready to put out fires or revert to the previous version in case of major failure.
Create the new version of the application at a different URL. Copy the production database to a new version, empty it, then copy over data for selected users and have them use the new URL. I.e., they would access the application from www2.example.com instead of www.example.com. Slowly move every user to the new version then switch the urls back.
This time I'm looking at doing something like a combination of the two methods. Basically, I'm thinking of moving a small number of users to the new service while keeping the same url.
Here's what I'm considering doing in the virtual host. Map.txt would be generated/updated when the new users are moved over. (I looked at using the prg rewrite map but am afraid of apache hanging waiting for the script.)
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /web/www.example.com
ServerName www.example.com
RewriteEngine on
RewriteMap deploymentmap txt:/web/map.txt
RewriteRule ^/id/([0-9]+)/(.*)$ ${deploymentmap:$1}/id/$1/$2
</VirtualHost>
map.txt:
10001 /web/www2.example.com/
10002 /web/www2.example.com/
10003 /web/www2.example.com/
10004 /web/www2.example.com/
10005 /web/www2.example.com/
Are there any obvious flaws in this deployment strategy? Am I missing some simple and effective, less painful, upgrade method?
Thanks in advance for any assistance.
-Paul