Re: question about using pgmemcache

From: Chris <dmagick(at)gmail(dot)com>
To: Juan Backson <juanbackson(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: question about using pgmemcache
Date: 2009-11-09 04:07:47
Message-ID: 4AF79593.2090305@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tim Uckun 2009-11-09 04:08:46 Re: I can't seem to put the right combination of magic into the pg_hba and pg_ident files.
Previous Message Juan Backson 2009-11-09 03:34:36 question about using pgmemcache