X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 156E9D1D2CE for ; Sat, 6 Mar 2004 02:57:05 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 43841-03 for ; Fri, 5 Mar 2004 22:57:05 -0400 (AST) Received: from jengate.thur.de (jengate.thur.de [217.17.193.190]) by svr1.postgresql.org (Postfix) with ESMTP id 05083D1CAD0 for ; Fri, 5 Mar 2004 22:57:00 -0400 (AST) Received: from jengate.thur.de (localhost [127.0.0.1]) by jengate.thur.de (8.12.11/8.12.9) with ESMTP id i262u5QL025331 for ; Sat, 6 Mar 2004 03:56:06 +0100 Received: (from uucp@localhost) by jengate.thur.de (8.12.11/8.12.6/Submit) with UUCP id i262u43j025330 for pgsql-admin@postgresql.org; Sat, 6 Mar 2004 03:56:04 +0100 Received: (from weigelt@localhost) by metux.de (8.12.10/8.12.10) id i262tBSw018851 for pgsql-admin@postgresql.org; Sat, 6 Mar 2004 02:55:11 GMT Date: Sat, 6 Mar 2004 02:55:11 +0000 From: Enrico Weigelt To: pgsql-admin@postgresql.org Subject: Re: Multi-Master Replication Message-ID: <20040306025510.GA16521@nibiru.metux.de> Reply-To: weigelt@metux.de References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/81 X-Sequence-Number: 12650 * Elielson Fontanezi [2004-03-02 15:47:13 -0300]: Hi, > I am in the need of using some multi-master replication for > postgres. I've implemented something in php. All my applications do their database access layer, where they only touch whole objects (the structure of each object class is modeled in class descriptors) - so it is quite easily solvable. But this works only under certain conditions: * all objects have an inode_id (as cluster-wide oid) and mtime field. * on create (in sql speaking: insert) a new inode_id is allocated from the inode_id sequence. this sequences has to be adjusted carefully so each cluster node gets its own id space. * on each write access, the mtime has to be set to the current time. * from time to time (i.e. once per minute) a pollout script runs over the object classes and fetches out the new records (by timestamp). they are the posted to the other nodes. (not necessarily to all - you can define sync neighbours on each node) Well, this is no general solution, but under some conditions (which are btw design rules for all my database applications), this works quite well. regards, -- --------------------------------------------------------------------- Enrico Weigelt == metux IT services phone: +49 36207 519931 www: http://www.metux.de/ fax: +49 36207 519932 email: contact@metux.de cellphone: +49 174 7066481 --------------------------------------------------------------------- -- DSL-Zugang ab 0 Euro. -- statische IP -- UUCP -- Hosting -- ---------------------------------------------------------------------