Skip site navigation (1) Skip section navigation (2)

Re: Multi-Master Replication

From: Enrico Weigelt <weigelt(at)metux(dot)de>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Multi-Master Replication
Date: 2004-03-06 02:55:11
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
* Elielson Fontanezi <ElielsonF(at)prodam(dot)sp(dot)gov(dot)br> [2004-03-02 15:47:13 -0300]:


>        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.

 Enrico Weigelt    ==   metux IT services

  phone:     +49 36207 519931         www:
  fax:       +49 36207 519932         email:     contact(at)metux(dot)de
  cellphone: +49 174 7066481
   -- DSL-Zugang ab 0 Euro. -- statische IP -- UUCP -- Hosting --

In response to

pgsql-admin by date

Next:From: Bruce MomjianDate: 2004-03-06 03:24:59
Subject: Re: per-database logging
Previous:From: Dario OttavianoDate: 2004-03-06 00:15:57
Subject: Problem with data format

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group