Re: Memcached for Database server

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Adarsh Sharma <adarsh(dot)sharma(at)orkash(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Memcached for Database server
Date: 2011-05-17 09:26:49
Message-ID: 4DD23F59.5030803@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 05/17/2011 01:31 PM, Adarsh Sharma wrote:

> At what stage we need memcached & what is the purpose of using it.

You might not need it. Depends on the nature of your app, its
performance requirements, how strict it is about always getting
consistent & current data, and how much money you have to throw at hardware.

As for what the purpose of using it is: Read the documentation.
http://code.google.com/p/memcached/wiki/FAQ

memcached works best in environments where some data changes rarely and
is queried extremely frequently. To use memcached, you must modify your
software to check memcached for that data before querying postgresql for
it. You must also modify your software to clear the memcached copy of
the data when it changes the data in postgresql, otherwise you might get
outdated copies of the data from memcached.

Even then, you have to be very careful about managing the cache and
avoiding race conditions if you store anything in memcached that you
can't afford to have a bit out of date. In general, it's best for
caching frequently queried things that don't change very often, don't
change at all within a given user session, etc.

If you want more help from the people here, spend some of your own time
making an effort to more clearly explain what your app does, what your
needs are, what language & platform you use, etc etc etc.

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gerhard Hintermayer 2011-05-17 09:30:10 Re: ordering of join using ON expression = any (array)
Previous Message Craig Ringer 2011-05-17 09:18:46 Re: Memcached for Database server