Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2007
    Posts
    7

    Unanswered: 2-Way Replication

    We are researching which database to use at our company. One of our requirements is 2-way replication. We have multiple offices (currently 2) that need access to our database and both offices add/update/delete records. The catch is our nework connection is not good and we cannot stop work when it is down. When it comes back up we need both databases to sync back up to each other. Can Postgres do this. I have seen multiple replication modules but they are master-slave. Can I have have both databases be both a master and slave, will this cause serious conflicts? Is there a Postgres solution to do this?

    Thanks

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Have you read Chapter 24 in the PostgreSQL v8.2 Documentation?

    Quote Originally Posted by pg_docs
    Statement-Based Replication Middleware
    With statement-based replication middleware, a program intercepts every SQL query and sends it to one or all servers. Each server operates independently. Read-write queries are sent to all servers, while read-only queries can be sent to just one server, allowing the read workload to be distributed.

    If queries are simply broadcast unmodified, functions like random(), CURRENT_TIMESTAMP, and sequences would have different values on different servers. This is because each server operates independently, and because SQL queries are broadcast (and not actual modified rows). If this is unacceptable, either the middleware or the application must query such values from a single server and then use those values in write queries. Also, care must be taken that all transactions either commit or abort on all servers, perhaps using two-phase commit (PREPARE TRANSACTION and COMMIT PREPARED. Pgpool and Sequoia are an example of this type of replication.
    You may also want to take a look at Postgres-R replication.
    Last edited by loquin; 02-01-07 at 13:29.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  3. #3
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848

    FYI: A follow-up...

    Cybertec has just announced a multi-master replication for PostgreSQL.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •