[Dbix-class] RFC: DBIx::Class::Storage::DBI::mysql_repl - replicated MySQL data source
Norbert CSONGRADI
bert at cpan.org
Wed Sep 6 11:53:32 CEST 2006
On Tuesday 05 September 2006 10:54, Lee Standen wrote:
> How does it handle replication lag?
Currently no handling at all in this module.
> I don't know if this happens in MySQL, but with DB2 replication, there
> is the potential for data being read to be 15 or more minutes out of
> sync with the "real" data on the master database. If this happens on
> MySQL as well, then there would be a necessity to query the row(s) you
> plan to update from the master database first, and then throw an
> exception if the data is different.
With our setup, it depends on the speed of the link between the master and
slaves. MySQL handles replication very well, data is replicated in a fraction
of a second if the link is fast enough.
The only problem we encountered so far if large amount of data is changed,
replication could slow down to 1 second and it could cause problems. Our
current fix for that if you expect a read operation right after your write
operation, you can set the database handle to "urgent" mode, which require
the next selects to go to the master database directly. Maybe I can integrate
this fix into this implementation.
I go and refactor all the thinggy with DBD::Multiplex and post the result
again in a couple of days anyway. mst++
--
Best regards,
Norbert Csongradi
More information about the Dbix-class
mailing list