[Dbix-class] Replicated DB - Best Practices

Dave Cross dave at dave.org.uk
Tue Mar 24 12:23:49 GMT 2009


I'm looking for some advice on best practice for dealing with replicated 
MySQL databases.

My current client has a large database which is split across a RW master 
and several RO slaves (I believe that's how MySQL replication always 
works). They're just toying with replacing a lot of their DB code with 
DBIx::Class.

I assume that other people have been working with similar architecture 
and I'd be grateful for any advice you might have. In particular we're 
thinking about problems like:

* How to decide whether to connect to the master or the slave
* Do we maintain a pool of database handles to both masters and slaves.
* Whether it ever makes sense to upgrade a slave connection to a master 
connection on the fly
* How referential integrity works in a world where a slave can be out of 
date compared to the master (actually, we know the answer to that one - 
"it doesn't")

All suggestions, gratefully received.

Cheers,

Dave...



More information about the DBIx-Class mailing list