[Dbix-class] Replication

Tim Bunce Tim.Bunce at pobox.com
Wed Oct 24 23:05:01 GMT 2007


On Wed, Oct 24, 2007 at 08:18:51PM +0100, Matt S Trout wrote:
> On Wed, Oct 24, 2007 at 11:37:50AM -0400, Jim Spath wrote:
> > What is the current state of replicated database support in DBIx::Class?
> > 
> > We are considering creating a master/slave setup with our MySQL 
> > database, but weren't sure if it would be easy to support it in our 
> > Catalyst/DBIx::Class applications.
> > 
> > From previous discussions on the list, it seems like DBD::MultiPlex is 
> > out of favor?
> > 
> > I searched CPAN and found DBIx::Class::Storage::DBI::Replication, which 
> > utilizes DBD::Multi.  It's labeled as experimental, which makes me 
> > nervous about using it in a production enviroment, but it sounds like 
> > exactly what I am looking for.  Is it stable?
> 
> The authors are using it in production.
> 
> They did not, however, write any tests for it. At all.
> 
> So I marked it EXPERIMENTAL on the grounds that the plural of anecdote is
> not data.
> 
> A client of Shadowcat's is also interested in this soon; much though I dislike
> being commercial on this list now would be a really good time for people who
> care about this to mail me at my work address and I'll see about organising
> one of the DBIC contribs we contract to do some sponsored test-writing split
> between all the commercial interests involved.

With a small change to DBD::multi it should be possible to use the DBI
test suite to test the "transparency" of DBD::Multi.

In theory you could just do this:

    DBI_AUTOPROXY='dbi:Multi:' make test

The only change needed would be for DBD::Multi to support this syntax

    DBI->connect("dbi:Multi:dsn=$the_dsn_to_connect_to", $user, $pass)

I'd highly recommend it. It's a great way to give 'transparent plumbing'
drivers like this a work out.

The DBI uses the same mechanism to test DBD::Gofer and I can vouch for
the fact that it's brutally effective at spotting all sorts of edge cases.
(I've not done any coverage analysis recently but I'm sure there are
many large gaps. That doesn't stop this approach being very helpful.)

Tim.



More information about the DBIx-Class mailing list