![]() |
|
Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Subclassing DBI and creating two connectionsby valdez (Monsignor) |
on Dec 03, 2005 at 16:29 UTC ( #513822=note: print w/replies, xml ) | Need Help?? |
I have the same setup and I suggest to write a wrapper around DBI that provides an handle for reading and one for writing; then use the read handle if you need to perform only reads, or use the write handle if you need to perform both writes and reads. The problem here is the time spent to replicate data from master to slave server: there is no warranty that you will be able to read from the slave the data written to the master few moments before. For a similar reason don't use now() in any insert or update statement, because the slave will not use the same timestamp used on the master. Ciao, Valerio
In Section
Seekers of Perl Wisdom
|
|