Do replicated sessions require sticky-sessions to be enabled?

186 views Asked by At

When using replicated sessions, is there any requirement to also use sticky sessions? Is there any advantage to using them together, or any disadvantage to using replicated-non-sticky sessions?

1

There are 1 answers

0
Christopher Schultz On

You are not required to use sticky-sessions when using session-replication, but you may want to use them anyway.

Since replication takes time to accomplish, there is a chance that a request can arrive at a cluster node while replication is occurring from a previous request. If the second request arrives at the same node where the initial request was handled, then the fact that the replication is still in-progress to other nodes is irrelevant.

On the other hand, if request 1 goes to node A and request 2 goes to node B, the replication after request 1 from A -> B could be incomplete when request 2 arrives at node B and the session state could be incomplete.

The only scenario I can think of where I'd want clustering (session replication) without sticky-sessions would be one where the session is established during login and nothing else of any value is stored in the session, and the session is not modified after login. In that case, a high-throughput cluster would benefit from allowing any node to service the request.

It is not a strict requirement that sticky-sessions be used in a clustered-environment. It's just that most applications (which use the session after login) will probably want sticky-sessions enabled with clustering.