[Dbix-class] Multiple DBs, one Schema to rule them all

Mike South msouth at gmail.com
Tue Mar 1 00:23:26 GMT 2011


On Fri, Feb 11, 2011 at 7:20 PM, Trevor Leffler <tleffler at uw.edu> wrote:

> Hello,
>
> I am investigating whether DBIC has support for switching between logical
> databases (ala 'use db1; ...; use db2; ...;').  I've a situation where th=
ere
> exist many cloned databases (same DDL), one per customer. The current mod=
el
> is that all customers share the same front-end, and it switches between D=
Bs
> as needed.  I would like to avoid the following: multiple open connections
> per app process,


Do you mean by this that you are keeping connections open between requests?
(I'm assuming you're talking about a web app I guess.)  Have you tried just
connecting every time instead?  On some databases this is not a heavy enough
operation to justify the work you will do to keep everything straight, make
sure the connection hasn't timed out, etc.  That can be hard stuff to debug.
 I'm just saying maybe it's premature optimization if you don't know whether
connection time is a bottleneck.

mike


> multiple MyDB::Schema objects, server hups upon customer adds/drops, etc.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20110228/05e=
46973/attachment-0001.htm


More information about the DBIx-Class mailing list