Is memcached really faster than MySQL on very simple query?

Greg Whalin gwhalin at meetup.com
Thu Jul 13 15:02:10 UTC 2006


I never considered the benefit to memcached as being a store that is
faster than our db.  The true benefit to memcached shows when you have
to scale your app beyond a single unloaded db.  DB machines are
expensive.  Memcache machines are cheap.  DB environment can be hairy to
scale.  Memcached is easy to scale.

I also see little benefit to using memcached as a query cache.  We use
it as an object cache.  We have objects that require several sql queries
to build, so serializing them and shoving them in cache is a huge win
for us.

greg

Perrin Harkins wrote:
> howard chen wrote:
>> seems MySQL is quite efficient in handling simple query?
> 
> From Perl, MySQL used to be about twice as fast as Memcached on simple
> queries.  Then Brad tweaked the client code a bit, and it's about on par
> now, as you saw in your test.  I suspect this is still mostly because of
> the client code -- the server is probably doing less than MySQL, so it
> should be faster, but DBI/BDB::mysql are written in C and
> Cache::Memcached is not.  If that long-rumored XS client ever comes out,
> I expect it will be faster than MySQL every time.
> 
> - Perrin



More information about the memcached mailing list