> Hi All, > My scenario needs me to retrieve multiple objects that have the same key. > Infact my scenario needs me to identify objects using multiple keys too, > but I can solve the multiple keys problem by adding one more entry to > memcached. So thats not my question. Is it possible to store multiple values > using the same key ? > > A parallel caching technology is Velocity > "http://msdn.microsoft.com/en-us/magazine/dd861287.aspx". Here we can create > something called regions, > within a cache instance. And I can split my data between regions. So that I > dont need to store multiple values using the same key. I can just create > regions, and every region can host my unique data. > > I also referred to > "http://stackoverflow.com/questions/1049833/multi-valued-hashtable-in-java". > I think its possible in java. But wondering if there > is a parallel in memcached (or should I do it the hard way/slower way, store > a map as value, get, add, set).
Collections aren't supported. Your options are to pack multiple values into a single key (Not sure why this is an issue? If you're fetching it all back anyway...), or to give them different keys and issue multigets to fetch item collections back. It's really never an issue in practice. If so I'd like to see benchmarks or code showing otherwise :/ Unless there's some specific feature about collections that you're looking for.
