Marco Canderle marcocanderle
Thu Mar 30 14:10:06 PST 2006
Hi, I'm new here so hello everyone. I've been experimenting with Slony-I to
deploy a replication system for the database at my work.

My objective is to have a master server in headquarter office, replicating
to every slave server at the satellite offices. The idea is that users
located in headquarters read from and write to master server. The users
located in satellite offices read from the local slave server and write
directly to the master server (which then replicates to all slaves
databases, including the one who originate the write).
This has to be done this way mainly for two reasons:
   -If the master gets offline, the remote users can continue accessing
information because they read from the local slave server.
   -An increase in the response time: The system is web-based (implemented
in PHP). For the remote users, in the other end of the country, the response
time is much more slower than for the users near the master server, due to
the Internet connection. And the majority of the database access are reads
not writes.

As I said, Reads are solved locally by every local slave server, and writes
are routed directly to the master server, which then replicates the changes
made.
Here is where my problem arise. If a user is connected to a slave server and
needs to make changes to de database, the writes will be passed to the
master server. The master will make the corresponding changes and Slony-I
will replicate this changes back to the slave who passed the writes (and all
other slaves). All this steps adds a delay until the remote user can see the
changes he/she made to the database reflected in his screen. For example if
the user adds a new product to the database, he won't see it in the products
list until  the replication takes place.
This kind of situations can make the system show wrong information, which is
dangerous in some scenarios of my system.

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 hope I've explained this clear enough. Thanks for your time!


********************************
Marco A. Canderle
marcocanderle at gmail.com
********************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gborg.postgresql.org/pipermail/slony1-general/attachments/20060330/6b4bd480/attachment.html



More information about the Slony1-general mailing list