Replies: 6 comments 10 replies
-
|
correct Issue link #24849 |
Beta Was this translation helpful? Give feedback.
-
|
Keycloak uses caches for two purposes; local/embedded caches to prevent going to the database for everything, and secondly for non-persisted sessions that are stored in a distributed, but still embedded cache. Unless you are deploying a HA architecture of Keycloak the cache aka Infinispan is just an embedded part of Keycloak, and not something you have to worry about separately. In that regard it's simpler to stick with Infinispan than consider some external cloud managed cache service. We have considered adding support for external caches so a Keycloak cluster can shared cached entities to prevent even more lookup in the database, but it's not something we prioritise at the moment since we believe the embedded caches work just fine. Now, if you wanted to completely rip out Infinispan from Keycloak that would require a cache solution that is embeddable in a Java application; otherwise you just wouldn't get the same performance as we offer today. Honestly at this point you may just want to disable caching and rely more on the DB (which can also cache things on its own). It would be a huge effort, with little value add really, so not something we would consider (at least not without significant proof of it being both better and something that a wider part of the community would want). So, stick with Infinispan is my suggestion ;) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
@ahus1 @pruivo @ryanemerson @stianst Considering the recent AWS outage ( https://aws.amazon.com/message/101925/ ) , do you think there might be increased demand for a multi-region Keycloak deployment? I believe ensuring high availability for Keycloak as a central authorization server is quite important. A multi-region setup could also help minimise downtime during such incidents. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @stianst, @ahus1, @slaskawi, @pruivo, @ryanemerson, Thanks for the detailed context shared. I would like to add some additional rationale for supporting Redis especially for active-active multi-region deployments and in relation to the “disconnected and synced clusters” approach @stianst described on Oct 16 Why Redis (in addition to, not instead of, Infinispan)? 1. Managed Cache Infrastructure : Many organizations standardize on server-less / managed services offering (AWS Redis ElastiCache, Azure Cache for Redis etc). Which provides
For Keycloak deployments, avoiding a separately self managed Infinispan cluster significantly simplifies operations 2. Active-Active Multi-Region Feasibility (Disconnected & Synced Clusters) Instead of relying on cross-region replication at the cache layer which as mentioned introduces latency and consistency concerns , a Redis-backed SPI could also support a disconnected and asynchronously synced model, such as:
This aligns closely with the idea @stianst mentioned: A Redis-backed provider could offer local low-latency operations while an independent sync layer maintains eventual consistency across regions. 3. Scalability for High-Throughput Workloads
This can be valuable for deployments pushing beyond what a single embedded Infinispan cluster can comfortably handle. What We Are Proposing We would like to explore:
Questions to the Team
Appreciate your thoughts and guidance on whether Redis support is something team can add it to the project’s roadmap, would be happy to contribute to the community |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @pruivo and @ahus1 for the thoughtful replies! The primary drivers for our use cases are
But totally agree to your points on the need for solving the open questions you have pointed out for "Disconnected and asynchronously synced clusters across regions" Based on @pruivo's suggestion, we will also explore implementing the existing remote provider interfaces backed by Redis |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, it would be great if keycloak could support redis cache as well apart from infinispan. The support for Memcached or Redis will be very helpful as these services are offered by cloud as managed services and can greatly help with ease of deployment and maintenance of large enterprises.
Referring to issue: #24849
What would be the level of effort and the scope of changes? If I were to implement, where should I start?
Regards,
Amar
Beta Was this translation helpful? Give feedback.
All reactions