I have multiple caches in play. Is it possible (or recommended) to store references in one object to another object that is in another cache? Is this acceptable design?
Objects from a db table A are stored in cache A and objects from db table B are stored in cache B. Object A maintains a list of B objects what are related to it in a many-to-many fashion. Do I store the object (B) reference in both A and in cache B or should I duplicate object B?
why would you want to do this? Different cache cfgs? How do your cache cfgs vary?
With such references, eviction will become a problem since even if an object is evicted from a cache it won't be gc'd unless all referencing objects are also evicted from the other cache.
And as for cache loading, object references will break once they are persisted.