X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A3F753A3B4B for ; Tue, 23 Nov 2004 02:18:12 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 64316-06 for ; Tue, 23 Nov 2004 02:18:04 +0000 (GMT) Received: from candle.pha.pa.us (candle.pha.pa.us [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 0FB1D3A3B43 for ; Tue, 23 Nov 2004 02:18:06 +0000 (GMT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id iAN2I5o22567; Mon, 22 Nov 2004 21:18:05 -0500 (EST) From: Bruce Momjian Message-Id: <200411230218.iAN2I5o22567@candle.pha.pa.us> Subject: Re: memcached and PostgreSQL In-Reply-To: To: =?ISO-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?= Date: Mon, 22 Nov 2004 21:18:05 -0500 (EST) Cc: pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL108 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UNKNOWN-8BIT X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/345 X-Sequence-Number: 9299 Pierre-Frédéric Caillaud wrote: > > > While an exception, this is a very real possibility in day to day > > operations. The absence of any feedback or balancing mechanism between > > the database and cache makes it impossible to know that they are in sync > > and even a small error percentage multiplied over time will lead to an > > ever increasing likelihood of error. > > Sure, but there are applications where it does not matter, and these > applications are othen loading the database... think about displaying > forum posts, products list in a web store, and especially category trees, > top N queries... for all these, it does not matter if the data is a bit > stale. For instance, a very popular forum will be cached, which is very > important. In this case I think it is acceptable if a new post does not > appear instantly. My point was that there are two failure cases --- one where the cache is slightly out of date compared to the db server --- these are cases where the cache update is slightly before/after the commit. The second is where the cache update happens and the commit later fails, or the commit happens and the cache update never happens. In these cases the cache is out of date for the amount of time you cache the data and not expire it. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073