[Dbix-class] Database too big.

Bill Moseley moseley at hank.org
Thu Apr 3 12:47:18 GMT 2014


I'm looking for some ideas here:

I'm working with a large Postgresql database.  It's getting too large and
busy. There is an existing DBIC schema for this database that is used by a
number of applications and tools.

There is a subset of tables in this database that are mostly isolated from
the other set of tables (i.e. joins are rare).  So, one thought here is to
pull this subset of tables out into a separate database.

But, then how to minimize the changes needed to all existing code that uses
DBIC for accessing this database?

One option is to hunt down every use of $schema for the subset of tables
and replace it with $other_schema.

But, is there anything I might do that is a bit more "clever"?:

$schema->resultset( 'Foo' )  # uses one database
$schema->resultset( 'Bar' )  # uses a different connection

so the existing application code would not requires so many changes?  (And,
no, I'm not expecting joins to work across those.)

That is, perhaps have two $storage objects and swap them out based on the
result source.

I'm sure it's not that simple -- for example thawing serialized DBIC
objects would need to have the correct storage associated, too.

Any other ideas?



-- 
Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20140403/4a8e9447/attachment.htm>


More information about the DBIx-Class mailing list