X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 7B9A0D1B57A for ; Mon, 29 Sep 2003 17:53:57 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 35770-05 for ; Mon, 29 Sep 2003 14:53:29 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 88210D1B563 for ; Mon, 29 Sep 2003 14:53:28 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3695019; Mon, 29 Sep 2003 10:42:11 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Achilleus Mantzios , pgsql-general@postgresql.org, Subject: Re: [SQL] Conditional row grained + FK dependency oriented lazy replication Date: Mon, 29 Sep 2003 10:40:55 -0700 User-Agent: KMail/1.4.3 References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309291040.55994.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/1814 X-Sequence-Number: 50033 Achilleus, > first off, i broadcast my case to as many people as possible, > maybe off topic for many, but maybe as well of interest for some. Also, I'm not sure what mailing list is appropriate. Probably General. > Also i speak sort of DBMirror terminology ( a great and simple tool). > The problem is as follows: > Tables must be replicated to remote sites (1 master, many slaves). > The tables are classified as > 1) Non replicated (nothing is specified for them, and eventually nothing > is done) > 2) Replicated to all slaves > 3) Conditionally replicated, so that a row is replicated only if it > matches some criteria (usually a comparison of a column value against a > remote site ID) You're talking about a fairly complex replication setup, over low bandwidth. For that, I would expect to create custom code to carry it out -- packaged solutions simply can't be optimized for anything as particular as this. > 4) Implicitly replicated. This is the hard case. Nothing is explicitly > declared for those tables, but the necessity of replicating them > comes from the FK constraints that tables in case 3) point to. > The problem with those tables is that we cannot know in advance if any > future record in some table of case 3) will point to a record currently > getting inserted into the db, and also there is a need for accounting > info for those tables, since we want to know whether they got inserted > at a remote site or not. Were it my project, I would replicate *all* updates for the FK tables, becuase of the impossibility of knowing what records would be needed in the future. Further, I would place some tight constraints on how and how much those tables could be updated as a way of controlling the size of the replication updates. Of course, segregating those referral records which could not possibly be used by certain sites would also restrict bandwitdh, but you've thought of that, I'm sure. -- Josh Berkus Aglio Database Solutions San Francisco