fs.
fs.

Reputation: 162

Postgresql Replication - replicate from a db node only to the master db

The scenario is like this: I have several, lets call them POS. There is one master DB on the main server that holds all the particular data from each one of the POS. Initially made all points connect directly to the main database to store all data, but we now need to allow the pos to work even is not possible to connect to the main db server.

now, we are trying to implement some kind of replication that enables us to let the individual POS save its data to its DB and after some time replicate the data to the main DB, but only to the main DB (not the other POS dbs). We tried using Bucardo and it works but the data from one POS gets replicated to all nodes (master-master replication i think).

      mainDB
pos1  pos2 ...posn

Each pos db only cares about its data and not the other's, and the main DB cares about all data from each node.

I'm not familiar with replication concepts and I'm having trouble understanding the right setup for this requirement. Thanks a lot.

Upvotes: 0

Views: 219

Answers (1)

Chris Travers
Chris Travers

Reputation: 26454

what you need to do is combine table inheritance with Slony, Bucardo, or the like. In this case each POS has a partition of a table that it owns for data insert purposes and it replicates data over Slony (master-slave with the POS being the master and the consolidated db being the slave).

In this way you might have tables invoice and invoice_lines. Each would have a subtable in the master db for each POS using table inheritance.

Upvotes: 1

Related Questions