I am currently learning about memcached/redis, and I am trying to figure out how could I use this kind of technology at work.

Now I understand that you should mostly cache data which is common to many user and which does not get modified every second.

In our architecture, we have a very relational data model data model combined with a fairly complex rights management system. To keep it simple, some objects are nested under some other objets with different types. An object can have several "parent". A given user can be given access to subset of the data with declaration such as user can read all objects which have parents a & b of types A and B. Things can get more complex with groups.

This makes very hard to predict which object can be seen by a given user. I also fail to see how can I come up with a good cache invalidation rule, because a lot of events may affect what a user is seeing (access rules modification, a parent is modified in the hierarchy, user added/removed from group etc).

So I feel that I will need to create a per user cache with low expected duration, which does not look very useful.

In this context, is there still hope to find a decent caching strategy? Am I making incorrect assumptions?

  • A per-user cache could still be used if it is expensive to build the in-memory model of their permissions. – Rory Hunter May 5 '14 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.