Re: question about using pgmemcache - Mailing list pgsql-general

From Chris
Subject Re: question about using pgmemcache
Date
Msg-id 4AF79593.2090305@gmail.com
Whole thread Raw
In response to question about using pgmemcache  (Juan Backson <juanbackson@gmail.com>)
List pgsql-general
Juan Backson wrote:
> Hi,
>
> I am planning to pgmemcache to act as a fast-accessible cache before my
> app and postgres.
>
> I have got it pgmemcache setup.  The question I have is that if
> memcached crashes, and I need to restart memcached, since memcached is
> not persistent, do I need to run some scripts to auto-recreate all the
> key value data from postgres?

It depends on how your app is using it. If it absolutely requires the
data to be in memcache, then yes. If it supports falling back to the db
if it doesn't find it in memcache (and then adding it to memcache), then
no - your app will re-populate memcache as it needs to.

> What is the easiest way to do it?  Is there anyway that I can write some
> syncup function to let postgres to do the re-creation of data to memcached.

You'll need to write your own script(s) to do this - memcache has no
idea what you want to cache (so there's no "auto sync" type script).

--
Postgresql & php tutorials
http://www.designmagick.com/


pgsql-general by date:

Previous
From: Juan Backson
Date:
Subject: question about using pgmemcache
Next
From: Tim Uckun
Date:
Subject: Re: I can't seem to put the right combination of magic into the pg_hba and pg_ident files.