3
votes

We are about to make another server for XPages applications. In front of it there will be fail over/load balance component (Microsoft Forefront, IBM Web server) that will redirect HTTP request to one of two cluster servers.

I suppose that scoped variables will be reinitialized in case of fail over - user is redirected to other server which will initialize XPage from scratch (GET) or subset of data (POST). Anything binded to beans/scoped variables will be lost (pager state, application specific data). This can cause odd behaviour to users: loss of entered data or opening of unexpected page. I am aware of fact, that this is highly depending on application design. The situation can be very similar to expired session on one server - how to prevent loss of data in such case.

Are there any coding best practices how to avoid side effects of fail over from server to server?

1

1 Answers

0
votes

While not a code best code best practise, you first need to configure your load balancer to keep users on the same session once started (probably_ using a cookie, so failover only happens when your box really goes down.

Secondly don't take scope variables to be there, always test for them - which is a good practice anyway since a session can timeout and loose its variables on a single server too. POST will fail due to a lack of x-session, so you might resort to posting only via Ajax that can have an error handler.

You could consider to use cookies to capture state information.