Skip site navigation (1) Skip section navigation (2)

Re: memcached and PostgreSQL

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: josh(at)agliodbs(dot)com
Cc: pgsql-performance(at)postgresql(dot)org,Michael Adler <adler(at)pobox(dot)com>,Darcy Buskermolen <darcy(at)wavefire(dot)com>
Subject: Re: memcached and PostgreSQL
Date: 2004-11-22 04:15:43
Message-ID: 200411220415.iAM4Fh908507@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Josh Berkus wrote:
> Michael,
> 
> > Still, it seems like a convenient way to maintain cache coherency,
> > assuming that your application doesn't already have a clean way to do
> > that.
> 
> Precisely.    The big problem with memory caching is the cache getting out of 
> sync with the database.   Updating the cache through database triggers helps 
> ameliorate that.
> 
> However, our inability to pass messages with NOTIFY somewhat limits the the 
> utility of this solution   Sean wants "on commit triggers", but there's some 
> major issues to work out with that.   Passing messages with NOTIFY would be 
> easier and almost as good.

The big concern I have about memcache is that because it controls
storage external to the database there is no way to guarantee the cache
is consistent with the database.  This is similar to sending email in a
trigger or on commit where you can't be certain you send email always
and only on a commit.

In the database, we mark everything we do with a transaction id and mark
the transaction id as committed in on operation.  I see no way to do
that with memcache.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-performance by date

Next:From: Josh BerkusDate: 2004-11-22 04:27:15
Subject: Re: memcached and PostgreSQL
Previous:From: Neil ConwayDate: 2004-11-21 14:51:58
Subject: Re: sort_mem affect on inserts?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group