Altering queries?

Josh Berkus josh at
Fri Sep 21 01:05:33 UTC 2007


> For instance, in my application each user has an ignore list, where they 
> can specify users they'd like to block.  Once blocked neither person can 
> see the existence of the other in the system anymore.  Now suppose user 
> A (who has blocked user B) is listing user C's friends, which contains 
> user B.  My SQL query would be something like select from Friends where 
> ID=C and where none of these members are on A's ignore list.
> Now, if I want to start storing each user's ignore list in Memcache, it 
> would mean I just grab C's friends list, then filter out the ignored 
> users in memcache using program logic.
> Is this a good way of using Memcache? Or is there a better way?

Seems like it wouldn't take much program effort, assuming that you have 
some good way of dealing with overlapping arrays.  So yeah, that's the 
way I'd do it.

--Josh Berkus

More information about the memcached mailing list