[Dbix-class] DBIx::Class and caching

Matt S Trout dbix-class at trout.me.uk
Sun Jul 20 01:05:10 BST 2008


On Tue, Jun 24, 2008 at 02:13:15PM -0400, David Steinbrunner wrote:
> Andreas Pronakis wrote:
> 
> > 4. If there isn't native support for the above, can someone give me any advice
> > and/or examples regarding using DBIx::Class and MemCache to achieve the same
> > result?
> 
> Data::ObjectDriver has built in support for syncing row objects with all
> find, search, update and delete operations in a number of caching systems
> including Memcached.  I have a side project in progress to bring this same
> type of functionality DBIx:Class.  At this point it is quite rough but
> supports everything but search, at least in in the basically usage I have
> been testing it against so far.

Awesome.

Here's how we were thinking about making this easier:

Refactor DBIC to move every db call to go through the ResultSource object

Then your global/semiglobal find() etc. caches can live there (since this
is the only per-table per-connection object, you can't cache it in the
resultset because it's ephemeral and you can't cache it in the class
because then you're fucked with multiple databases).

Should be easy to just write a ResultSource mixin that then provides
whatever caching strategy you want.

Would you be interested in taking a branch off of 0.09/trunk and having a
go at this? I think if we got started with the refac the other people who've
been looking at the same stuff would probably turn up an help :)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the DBIx-Class mailing list