Multiple delete

Justin jmat@shutdown.net
Wed, 17 Dec 2003 11:13:19 -0500


That would be useful --- if all of your objects are stored in the same
memcached server.. :)

At least for my configuration, they rarely are.  The client distributes
objects fairly evenly among all six of my (really pathetic, underpowered)
memcached servers. The way the API works, it takes the key, hashes it, and
decides what server to store it on from the hash. 

If I want to delete a bunch of things at once (say a user record changes in
the DB, and I've generated a bunch of cached objects because of it
(uid->username map, user record object, etc)), I have to just issue a bunch
of deletes with the appropriate key -- so the API will go to the right
server and nuke it.. 

If you were to have one big mega-memcached server, then multi-delete would
rock.


-----Original Message-----
From: memcached-admin@lists.danga.com
[mailto:memcached-admin@lists.danga.com] On Behalf Of Jon Valvatne
Sent: Wednesday, December 17, 2003 10:16 AM
To: memcached@lists.danga.com
Subject: Multiple delete

I believe the issue has been addressed previously on this list, but the
only answer I saw was that there wouldn't be a big win involved in
implementing this. I'm wondering if I could get that statement
qualified:

Let's say updating a certain item in the database invalidates several
hundred fairly large items in memcached. Would it not be beneficial to
issue the needed deletions as a single command? I'm new to memcached and
haven't looked very closely at the internals yet, so I may be
overestimating the penalties involved in performing large numbers of
separate transactions. Or is it just generally a _bad idea_ to put
yourself in the situation where you have to invalidate such large
numbers of items with each update?

Thanks in advance,

Jon Valvatne