[Pgpool-hackers] cache for pgpool

Jim C. Nasby jnasby at pervasive.com
Tue May 16 17:10:52 UTC 2006


On Tue, May 16, 2006 at 09:55:23AM +0200, Jean-Max Reymond wrote:
> 2006/5/15, Jim C. Nasby <jnasby at pervasive.com>:
> > On Mon, May 15, 2006 at 04:33:42PM +0200, Jean-Max Reymond wrote:
> > > hi,
> > > I am currently writing a memory cache for postgres requests.
> > > It is a very basic way to do it (? la mysql) but very useful for web
> > > applications or applications using a lot of count(*).
> > > is pgpool the good place to add these feature ?
> >
> > How does this differ from memcached?
> 
> no need to change your application.
> just run pgpool and the requests are cached. If an update occurs, all
> the data caches for this table are cleared.
> just ? la mysql. For my web application, mysql cache 67% of the
> requests and it is mandatory to have a cache if I want to switch to
> Postgres :-)

Probably either pgpool or a stand-alone connection layer would be best.

BTW, Sean Chittenden of FreeBSD fame has written pgmemcached that
provides an API from PostgreSQL to memcached. Among other things, this
allows you to invalidate data in memcached when it changes in the
database. http://pgfoundry.org/projects/pgmemcache/

Of course, it's better to write applications so that they don't abuse
the database, but I guess caching results is better than nothing...
Hopefully some day people will understand that having a web page
generate 50 queries isn't such a hot idea.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby at pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461


More information about the Pgpool-hackers mailing list