Dirk Jagdmann jagdmann
Sat Apr 1 04:39:05 PST 2006
Hello Marco,

> So I ask: Are there any solutions that may help me reduce/avoid this delay
> or at least prevent the slave server to respond to the user until the
> replication have propagated to all the slaves (or at least the one which
> originates the writes)? Maybe some kind of combination between asynchronous
> replication (provided by Slony-I) and synchronous replication?

I think you should not try to solve this issue in the database, but
rather your application. I would suggest you setup your application,
so that read requests to the database are initially done on the slave
servers (for remote sites) and once you have to do any write queries
you switch your database connection to the master site and from that
point on use the master db for the rest of the application session. Of
course you could be a bit more fancier, so that you add a timeout
value (for example 1min, but you should see how fast your replication
works) and if there have not been any write queries in the last
"timeout" minutes (or seconds or whatever) you can switch your
database connection back to a slave.

--
---> Dirk Jagdmann
----> http://cubic.org/~doj
-----> http://llg.cubic.org



More information about the Slony1-general mailing list