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 -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general