You could have a double fetch implementation: basically have a bookid as key and store the object under this key, but then have a secondary mappings of whatever (isbn, amazon_id) to book id. So getting the actual object will always require 2 lookups: get bookid integer and then fetch the actual object based on that id. Will that work?
Boris On Thu, Dec 18, 2008 at 3:16 PM, Josef Finsel <[email protected]> wrote: > Short answer, no. > > Basically you're describing tags. It's been an oft discussed topic but > there are lots of issues related to implementing it without losing a lot of > performance. > > On Thu, Dec 18, 2008 at 3:13 PM, Advt <[email protected]> wrote: > >> >> Hi there guys, >> >> This was probably asked before but I couldn't find it on the list, so >> I'll just go ahead and ask. >> Is there a way to have more than one key assigned to a single object ? >> >> In order to have several ways of pointing to a single object, but only >> storing one copy of the object on the memory. I understand that this >> could also mess up a lot of things, including the hashes for object >> distribution between several servers, since the key is used to >> determine in which memcached an object resides. >> >> One example of this would be, for example, let's say we have objects >> that might have more than one "primary key" that is used to identify >> it, for whatever reason. For example, a system that catalogs books, >> where we have our internal "book_id", but where we also might want to >> fetch books by their ISBN ("book_isbn") or by the unique identifier >> that Amazon uses for this book ("book_amazon_id"). So, it would be >> nice to be able to apply three keys to the same object (if we ignore >> the problems that might bring in environments with lots of servers). >> >> Any thoughts on that ? >> >> []'s >> D > > > > > -- > "If you see a whole thing - it seems that it's always beautiful. Planets, > lives... But up close a world's all dirt and rocks. And day to day, life's a > hard job, you get tired, you lose the pattern." > Ursula K. Le Guin > > http://www.finsel.com/words,-words,-words.aspx (My blog) - > http://www.finsel.com/photo-gallery.aspx (My Photogallery) - > http://www.reluctantdba.com/dbas-and-programmers/blog.aspx (My > Professional Blog) > -- --Boris
