Dear list,

first of all apologies if this is a re-post - I've had no reply since
sending this on 2012-05-21 and having lurked on the list for a few
months now that seems unusual. I can't check whether the message hit
the list because the archive contains no recent posts.

Anyway, I'd appreciate your collective wisdom on the following
problem. My company uses a 2-tier web architecture for those parts of
the website that are dynamic:

* Presentation (pres.) server (in our parlance the "frontend" service)
- responsible for content generation.
* API server (in our parlance the "backend" service) - performs
business logic, supplies business objects to the presentation server,
handles AJAX requests directly.

We wish to implement a means of deploying new code (pres. and API
versions that have been tested together, referred to as logical
versions 'X' and 'Y') to a subset of a group servers balanced by a
single haproxy instance. We will then measure the live performance of
the new vs old code before completing the deployment or rolling back.

In summary:

* There should be user affinity to pres. version 'X' or 'Y'.
* An API request from the browser with affinity to pres. 'X' should
ideally go to an API server running 'X', falling back to any available
version. Ditto 'Y'.
* An API request from a pres server running version 'X' should ideally
go to an API server running 'X', falling back to any available
version. Ditto 'Y'.

We have implemented this as follows:

* Browser <-> server affinity managed using a cookie inserted by haproxy
* Server <-> server affinity managed an http header set by the pres.
server indicating preferred API server version.

The config representing the above is
https://gist.github.com/f7075d6fb1b5d00ddf52: Note that this
represents the configuration in the old vs new state, the
configuration for each step of the release process is templated.

Does this solution reasonable?

Thanks,

Ben Tisdall.

Reply via email to