Ühel kenal päeval, N, 2006-03-30 kell 19:10, kirjutas Marco Canderle:
> 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 think that what you need, is not slony, but some other system, similar
to slony, maybe even using parts of slony.

The problem is relly not "If/when the master gets offline" but "If/when
the master becomes inaccessible from slave(s)", usually due to network
problems.

You will most likely need an synchronous some queueing system which can
detect this condition, and save updates in a local queue if master is
inaccessible. You still need to consider all possible
inaccessibility/downness cases and devise appropriate solutions (or tell
your customers/businesspeople about the possible  failure modes and let
them approve these (or worry about buying redundant network
connections/server hardware if the data availability is really
critical))

------------
Hannu


_______________________________________________
Slony1-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/slony1-general

Reply via email to