From: Eric Hodel Date: 2008-02-23T05:07:22+09:00 Subject: Re: Memcached: Dealing with unknown keys On Feb 14, 2008, at 14:33 PM, Tony Garcia wrote: > Ben Bleything wrote: >> On Fri, Feb 15, 2008, Tony Garcia wrote: >>> I need to pass information (for example, an email address) based >>> on user >>> name from a rails application to a disconnected ruby process >>> through the >>> cache. The external process has no way to know what users are being >>> passed to it. I had wanted to use the user name as the key, but it >>> seems >>> that I can't find the values of current keys in the cache - at >>> least not >>> with memcache-client. >> >> It sounds like you're trying to use the cache as a message queue, >> when >> you should probably be using both in tandem... that is, store user >> data >> in the cache, but send messages along the queue with the user name, >> so >> the disconnected process can look it up in the cache. > > Only the username, email address, and a code are being stored - there > are no messages or other items that need to be passed along. > >> Caching in general (and memcache in particular) are intended to >> speed up >> slow data access, not to act as data repositories. > > Granted - and I am using memcache as a queue in this case. I've done a > lot of looking and can't find much else that will do what I need - and > Joyent has memcache already installed. > > If anyone has a better suggestion, I'd love to hear it. This is the > best > I've been able to figure out on my own. memcached is the wrong tool for this purpose. It is intended to be a cache for some other persistent storage service.