[Dbix-class] Replicated DB - Best Practices

John Goulah jgoulah at gmail.com
Tue Mar 24 12:27:55 GMT 2009


On Tue, Mar 24, 2009 at 8:23 AM, Dave Cross <dave at dave.org.uk> wrote:
>
> 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.
>



Dave,

DBIx::Class::Storage::DBI::Replicated  will handle this for you

http://search.cpan.org/~ribasushi/DBIx-Class-0.08099_07/lib/DBIx/Class/Storage/DBI/Replicated.pm

Thanks,
John



More information about the DBIx-Class mailing list