X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 96467D7357 for ; Wed, 24 Aug 2005 13:31:14 -0300 (ADT) 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 22537-01 for ; Wed, 24 Aug 2005 16:31:08 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id E1F9ED732F for ; Wed, 24 Aug 2005 13:31:07 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.13.1/8.13.1) with ESMTP id j7OGV7QM027742 for ; Wed, 24 Aug 2005 16:31:07 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.13.1/8.13.1/Submit) id j7OG43bh068280 for pgsql-general@postgresql.org; Wed, 24 Aug 2005 16:04:03 GMT (envelope-from news) From: Chris Browne X-Newsgroups: pgsql.general Subject: Re: Postgresql replication Date: Wed, 24 Aug 2005 11:54:42 -0400 Organization: cbbrowne Computing Inc Lines: 65 Message-ID: <60fyszpby5.fsf@dba2.int.libertyrms.com> References: <20050824122150.14159.qmail@web53214.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.17 (Jumbo Shrimp, linux) Cancel-Lock: sha1:X2J1BPDlGH6FnazQQegVy+vK3F4= To: pgsql-general@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=-2.459 required=5 tests=[ALL_TRUSTED=-2.82, AWL=0.361] X-Spam-Level: X-Archive-Number: 200508/1224 X-Sequence-Number: 82632 carlosreimer@yahoo.com.br (Carlos Henrique Reimer) writes: > Currently we have only one database accessed by the headquarter and > two branches but the performance in the  branches is very poor  and > I was invited to discover a way to increase it. > > One possible solution is replicate the headquarter DB into the two > branches. > > I read about slony-i, but then the replicated DBs will be read-only. Correct. > Pgcluster is a sync solution and I think is not fited for us becase > the replicated DBs will be located remotely and we have a lot of > updates on the DBs. Unfortunately, pgcluster isn't much maintained anymore. > I think I´m looking for a master-slave assynchronous solution. I > know pgReplicator can do it, but I think the project is not active > any more. Slony-I is a master/slave asynchronous replication system; if you already considered it unsuitable, then I see little likelihood of other systems with the same sorts of properties being suitable. What could conceivably be of use to you would be a *multimaster* asynchronous replication system. Unfortunately, multimaster *anything* is a really tough nut to crack. There is a Slony-II project ongoing that is trying to construct a more-or-less synchronous multimaster replication system (where part of the cleverness involves trying to get as much taking place in an asynchronous fashion as possible) that would almost certainly be of no use to your "use case." The most successful "multimaster asynchronous" replication system that I am aware of is the PalmComputing "PalmSync" system. It would presumably be possible to use some of the components of Slony-I to construct a multimaster async replication system. A pre-requisite would be the creation of some form of "distributed sequence" which would try to minimize the conflicts that arise out of auto-generation of sequence numbers. But beyond that lies the larger challenge of conflict resolution. Slony-I, as a single-master system, does not need to address conflicts, as changes must be made on the "master" and propagate elsewhere. Synchronous multimaster systems address conflicts by detecting them when they occur and rejecting one or another of the conflicting transactions. Asynchronous multimaster systems require some sort of conflict management/resolution system for situations where tuples are being concurrently updated on multiple nodes. How that is managed is, well, troublesome :-(. The PalmSync approach is that if it finds conflicts, it duplicates records and leaves you, the user, to clean things up. That may not be suitable for every kind of application... -- (reverse (concatenate 'string "gro.gultn" "@" "enworbbc")) http://cbbrowne.com/info/slony.html ((LAMBDA (X) (X X)) (LAMBDA (X) (X X)))