On 5/29/07, Oleg Pronin <[EMAIL PROTECTED]> wrote:
How do you plan to deal with multiprocess web-servers ?
Separate processes do not know what the others change.

The only solution i found is to cache data for some time (based on how much
realtime do you need).

memcached is designed to handle this, both for multiple processes on
one webserver and multiple webservers in a datacenter.  However, you
have to wrap memcached with cache invalidation (custom for all of your
data access).  The generic pattern (not specific to DBI or
DBIx::Class) is that you wrap your real database API in a higher-level
API of getter/setter methods, and do something like:

sub get_foo {
   # return memcache entry if available, populate it from the DB and
return it if not
}

sub set_foo {
   # Set the new value in the DB and update the memcache entry too
}

But this solution doesn't generalize to all of DBIx::Class access very
well without parsing WHERE clauses.

-- Brandon

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to