Peer to peer replication of Postgresql databases

Поиск
Список
Период
Сортировка
Искать

Peer to peer replication of Postgresql databases

От:
Anuradha Ratnaweera <anuradha@lklug.pdn.ac.lk>
Дата:

Hi all,

I am trying to add some replication features to postgres (yes, I have
already looked at ongoing work), in a peer to peer manner.  The goal
is to achive `nearly complete fault tolerence' by replicating data.

The basic framework I have in mind is somewhat like this.

- Postmasters are running on different computers on a networked cluster.
  Their data areas are identical at the beginning and recide on local
  storage devices.

- Each postmaster is aware that they are a part of a cluster and they
  can communicate with each other, send multicast requests and look for
  each other's presence (like heartbeat in linux-ha project).

- When a frontend process sends a read query, each backend process
  does that from its own data area.

- There are two types of write queries.  Postmasters use seperate
  communication channels for each.  One is the sequencial channel which
  carries writes whose order is important, and the non-sequencial
  channel carries write queries whose order is not important.

- When a frontend process sends non-sequencial write query to a backend,
  it is directly written to the local data area and a multicast is
  sent (preferably asynchronously) to the other postmasters who will
  also update their respective local areas.

  May be we can simply duplicate what goes to WAL into a TCP/IP socket
  (with some header info, of course).

- When a sequencial-write query is requested, the corresponding
  postmaster informs a main-postmaster (more about in the next point),
  waits for his acknowledgement, and proceeds the same way as the
  non-sequencial write.

- Each postmaster is assigned a priority.  The one with the highest
  priority is doing some bookkeeping to handle concurrency issues etc.
  If he goes away, another one takes charge.

  Or maybe we can completely ignore the main-postmaster concept and
  let the clients broadcast a request to obtain locks etc.

- When a new postmaster, hence a computer, joins the cluster, he
  will replicate the current database from one of the clients.

Suggessions and critisisms are welcome.

	Anuradha

-- 

Debian GNU/Linux (kernel 2.4.18-xfs-1.1)

The best audience is intelligent, well-educated and a little drunk.
		-- Maurice Baring

Re: [HACKERS] Peer to peer replication of Postgresql databases

От:
Anuradha Ratnaweera <anuradha@lklug.pdn.ac.lk>
Дата:
On Fri, Oct 11, 2002 at 03:54:15PM +0530, Shridhar Daithankar wrote:
>
> On 11 Oct 2002 at 16:16, Anuradha Ratnaweera wrote:
> 
> > I am trying to add some replication features to postgres (yes, I have
> > already looked at ongoing work), in a peer to peer manner.  The goal
> > is to achive `nearly complete fault tolerence' by replicating data.
> 
> Sounds a lot like usogres. You got it running. (I never had a chance.) I would 
> like to hear how it compares against it.
> 
> Can anybody comment how maintained usogres is. It covers an important area of 
> replication but I am not sure how maintained that is. If it is not, I suggest 
> we pick it up and finish it.

I will look at it, too.  Thanks for the link.  In some cases, starting
anew is faster than learning unmaintained existing code.

My original mail would have been much shorter if it simply stated that I
want to add `application level RAID-0' to postgres ;)

	Anuradha

-- 

Debian GNU/Linux (kernel 2.4.18-xfs-1.1)

I think the world is run by C students.
		-- Al McGuire

Re: Peer to peer replication of Postgresql databases

От:
Anuradha Ratnaweera <anuradha@lklug.pdn.ac.lk>
Дата:
On Fri, Oct 11, 2002 at 04:04:29PM +0530, Shridhar Daithankar wrote:
> On 11 Oct 2002 at 16:29, Anuradha Ratnaweera wrote:
> 
> > On Fri, Oct 11, 2002 at 03:54:15PM +0530, Shridhar Daithankar wrote:
> > I will look at it, too.  Thanks for the link.  In some cases, starting
> > anew is faster than learning unmaintained existing code.

Ok.  Checked out what usogres is.  It is not what I want.  I don't want
a static `main database'.  It should simply a cluster of them - just like
a set of Raid-0 disks, may be with a tempory controller for some tasks.

Also, as a matter of fact, usogres is not unmaintained code.

> While that's true, usogres code is just few files. I wouldn't take more than 
> half an hour to read up the things. And besides it contain postgresql protocol 
> implementation necessary which would take some time to test and debug,

Great.  I will look into this over the weekend.

> And it's in C++. I like that..;-)

And I DON'T like that ;)

	Anuradha

-- 

Debian GNU/Linux (kernel 2.4.18-xfs-1.1)

QOTD:
	"I ain't broke, but I'm badly bent."

FAQ