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 D7005D7FD5 for ; Thu, 25 Aug 2005 10:06:56 -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 69369-08 for ; Thu, 25 Aug 2005 13:06:53 +0000 (GMT) Received: from smtp.uk.colt.net (smtp.uk.colt.net [195.110.64.125]) by svr1.postgresql.org (Postfix) with ESMTP id 0A335D7FD0 for ; Thu, 25 Aug 2005 10:06:51 -0300 (ADT) Received: from [10.0.1.4] (117-21-161-212.DSL.ONCOLT.COM [212.161.21.117]) by smtp.uk.colt.net (Postfix) with ESMTP id 7D2C4126F08 for ; Thu, 25 Aug 2005 14:02:53 +0100 (BST) From: David Goodenough To: pgsql-general@postgresql.org Subject: Re: Postgresql replication Date: Thu, 25 Aug 2005 14:06:51 +0100 User-Agent: KMail/1.7.2 References: <60fyszpby5.fsf@dba2.int.libertyrms.com> <20050825114411.GA30455@bafster.chello.upc.cz> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200508251406.52090.david.goodenough@btconnect.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.254 required=5 tests=[AWL=-0.120, DNS_FROM_RFC_ABUSE=0.374] X-Spam-Level: X-Archive-Number: 200508/1264 X-Sequence-Number: 82672 On Thursday 25 August 2005 13:03, William Yu wrote: > As far as I know, nobody has a generic solution for multi-master > replication where servers are not in close proximity. Single master > replication? Doable. Application specific conflict resolution? Doable. > Off the shelf package that somehow knows financial transactions on a > server shouldn't be duplicated on another? Uhh...I'd be wary of trying > it out myself. The most obvious one that does exactly this (generic multi-master replication) is Lotus Domino. It is not a relational DB, but not sufficiently far off to stop the analogy. Domino marks each document with a binary value which identifies the server (built from a hash of the server name and the time the DB was created) and a timestamp when it was last modified, and also each document (record) has an ID (like OIDs). More recent versions also do this at a field level to avoid conflicts and speed replication. When two servers replicate they look for all documents modified since the last replication time, and compare the list. Those only modified on one server are copied across to the other server replacing the old record and carrying the updated on server and timestamp with them. When a document is deleted in Domino it actually does not dissapear, it is reduced to a deletion stub, and this gets replicated as it has the same ID as the original record. Those that have been modified on both sides are copied to the other DB, but both records remain and it is left to the user to resolve conflicts. Field level replication reduces the need for this considerably. Periodically the deletion stubs are purged, once all known replicas have replicated. Domino has absolutely no concept of a master DB. Obviously this scheme would be difficult to do on a pure relational system. But with triggers and a few standard fields it would not be impossible to do for a limited application set. How the user would resolve conflicts would also be application specific I suspect and how one would relate having two version of a record in the DB then they both have a field which is supposed to be unique is also a problem that would have to be resolved (Domino does not have the concept of unique keys). David > > Bohdan Linda wrote: > > I would have a slight offtopic question, this is issue only of pgsql or > > there are some other db solutions which have good performance when doing > > this kind of replication across the world. > > > > Regards, > > Bohdan > > > > On Thu, Aug 25, 2005 at 09:01:49AM +0200, William Yu wrote: > >>It provides pseudo relief if all your servers are in the same building. > >>Having a front-end pgpool connector pointing to servers across the world > >>is not workable -- performance ends up being completely decrepit due to > >>the high latency. > >> > >>Which is the problem we face. Great, you've got multiple servers for > >>failover. Too bad it doesn't do much good if your building gets hit by > >>fire/earthquake/hurricane/etc. > > ---------------------------(end of broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly