[keycloak-dev] investigating caching

Stian Thorgersen stian at redhat.com
Thu Jun 5 10:18:01 EDT 2014


Sure, I was just thinking that if we have to do a fair amount of reorganizing any-ways (i.e. query users from KeycloakSession instead of RealmModel), then it may be a good time to introduce this.

The benefit would be that we don't create managers manually, and we could shift more of the shared logic out of the models into the managers.

----- Original Message -----
> From: "Bill Burke" <bburke at redhat.com>
> To: "Stian Thorgersen" <stian at redhat.com>
> Cc: keycloak-dev at lists.jboss.org
> Sent: Thursday, 5 June, 2014 3:14:35 PM
> Subject: Re: [keycloak-dev] investigating caching
> 
> We can, but querying is still model specific.
> 
> On 6/5/2014 10:05 AM, Stian Thorgersen wrote:
> > Makes me wonder if we should extend the *Manager approach and only call the
> > model through that. For example:
> >
> >    RealmManager realmManager = ??
> >    UserManager user = realmManager.getUser(userId)
> >
> >
> >
> >
> > ----- Original Message -----
> >> From: "Bill Burke" <bburke at redhat.com>
> >> To: keycloak-dev at lists.jboss.org
> >> Sent: Thursday, 5 June, 2014 1:51:47 PM
> >> Subject: [keycloak-dev] investigating caching
> >>
> >> I think I have a decent way of doing caching, but it is going to take a
> >> refactoring of the Model API and KeycloakSession API so that caching can
> >> be layered (i.e. that we can cache realms/apps, but not cache users).
> >> For instance, the JPA adapter pretty much is hard-wired to have a loaded
> >> entity before it makes queries like "select user where user.realm = ?
> >> and user.name = ?".  We need to move things like user queries up to the
> >> KeycloakSession level so that we can use things like
> >> EntityManager.getReference() so that we're not making extra DB calls if
> >> we need to query a user.
> >>
> >> --
> >> Bill Burke
> >> JBoss, a division of Red Hat
> >> http://bill.burkecentral.com
> >> _______________________________________________
> >> keycloak-dev mailing list
> >> keycloak-dev at lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/keycloak-dev
> >>
> 
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
> 


More information about the keycloak-dev mailing list