-----BEGIN PGP SIGNED MESSAGE-----                       
Hash: RIPEMD160                                          


> Sorry if that wasn't clear.  The goal is to reduce load on the database.
>                                                                         
> Using Slony replication with a single master and multiple slaves we want the
> application to transparently send selects to the pool of slaves, but any    
> updates (and transactions) must go to the master.  Slony replication is     
> asynchronous so after a write all selects go to master for a configured     
> amount of time to allow slaves to sync.
>
> The goal of this email was to see if anyone is doing something similar.

Similar, yes: using Bucardo to create two masters and a handful (~8) of slaves.
Rather than a middleware to route things around (which can be dangerous
as a transaction should probably not do writes to the master and select
from a slave due to the async nature of Slony and Bucardo), the application
is tasked with the job of knowing which to hit and when. Specifically, there
are two classes of database handles, "readwrite" and "readonly". The
application then chooses which one to use depending on the situation, oft
times switching back and forth as needed (with the general rule of "any
changes made via the readwrite handle should continue to use that handle,
even for reads, in the current session").

The other danger in trying to be too transparent is that you quickly get
into advanced SQL parsing, and deciding if the SQL statement contains any
write access to the database - easy enough for IUD, but tricky when a SELECT
contains function calls, any of which may or may not do database writes.

- --
Greg Sabino Mullane [email protected]
End Point Corporation
PGP Key: 0x14964AC8 200907101917
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkpXzBMACgkQvJuQZxSWSsidsQCgrG2kNh80vuYqDEj0pzrygJCx
J8kAn2wXyWDhmF+UuLhiSPmsEjKR2dIF
=g95z
-----END PGP SIGNATURE-----


Reply via email to