Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Subclassing DBI and creating two connections

by valdez (Monsignor)
on Dec 03, 2005 at 16:29 UTC ( #513822=note: print w/replies, xml ) Need Help??

in reply to Subclassing DBI and creating two connections

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://513822]
[Your Mother]: The good news is, they think they are influencing people but Americans at least are irretrievably biased. All that can be accomplished is a little spike in domestic violence. :P
[LanX]: YM: watch your mouth or I'll show up with my automatic gun at your nursery ...
[LanX]: ;-P
[LanX]: What I learned now is to hide my friends list at FB (not that I have many ...)
[Your Mother]: Careful. They're listening!
[LanX]: I mean hiding my friends FROM my friends

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2018-03-19 13:29 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (240 votes). Check out past polls.