Is it possible to replace Infinspan in Keycloak with a centralized cache store like Redis or Memcached?
It took us a while but we finally got Keycloak running in clustered mode using JDBC_PING on Amazon’s ECS cluster service. We have also played with several configurations like a single owner for the Infinisan caches or multiple owners and sticky sessions or non-sticky sessions. Even though sticky sessions has its downsides, like potentially losing sessions, we’d prefer to run this way as it is the most performant solution as caches do not have to be replicated to the entire cluster. One of the problems we’ve run into is that the AWS ALB does not seem to want to route new sessions very evenly when sticky sessions are turned on. Eventually one of the cluster nodes ends up dying under load (and all the associated sessions are lost).
All this would be much easier to configure if we could just cut out JGroups and Infinispan and have keycloak talk to Redis or Memcached while running in standalone mode. I do realize that performance will be slightly slower as objects will have to be serialized/deserialized, but the benefits of being able to dynamically scale the cluster without having to have users potentially re-login would be very beneficial to us.
Is this possible? Has anyone ever done it?
I saw this answer on SO, but I’m not interested in having to customize a bunch of SPIs to do this.