[keycloak-dev] sticky sessions for UserSession

Marek Posolda mposolda at redhat.com
Tue Sep 23 03:09:21 EDT 2014


I think that generally there are 2 main purposes of clustering:
a) scalability and better performance (ideally n-times better 
performance with n nodes in cluster)
b) failover

With in-memory session you will achieve (a), but (b) won't be addressed. 
So if you have 2 keycloak nodes and you kill node-1, then all 
UserSessions on node-1 will be lost and users would need to relogin. IMO 
Sticky sessions are good, but there is still need to replicate sessions 
(at least to 1 additional cluster node) if you want to address failover. 
Or am I just not understand correctly what you meant?

Marek

On 22.9.2014 22:14, Bill Burke wrote:
> Was thinking about clustering.  Sticky sessions combined with in-memory
> only UserSessions might be best for clustering.  We'll need to change
> access code processing so that it is a) signed and b) contains the
> callback URL.  In looking at SAML, it jsut seems we need to have the
> notion of an HttpSession and the idea of loading this session from a
> database (or even a clustered cache) doesn't seem very feasible or scalable.



More information about the keycloak-dev mailing list