Cache Graph for Ruby on Rails


Do you know any Ruby gem or library that implements cache with dependency graph? I’m looking for a solution for organizing cache objects to a graph structure and it’s intelligent enough to invalidate all the dependencies of a node recursively when the node becomes invalid. It’s just better if it supports Memcached or Redis as a storage engine.


What will be the case when node will become invalid?
When a node becomes invalid then all of its descendants would become invalid. Let me give you an example. There is a user-12 node that is a cache node for user#12. This parent node does not store data. It has subnodes for the attributes, user-12-name, user-12-email,… Only the leaves store data. When user#12‘s email address is updated then only cache user-12-email would be invalidated but the others would remain active. When the user is being deleted then the parent node (user-12) would become invalid and all of its dependencies, so user-12-name, user-12-email.
– Nucc
21 hours ago