[Dbix-class] DBIx::Class::Storage::Replication -- stick to master flag

Bill Moseley moseley at hank.org
Mon Jan 4 02:47:42 GMT 2010


I'm just looking at this module and one thing I'd like to be able to do is
tie reads to the master for some period of time for a given id (say an
account id) after a write to the master.  The goal is to force all reads
(from multiple process) from the master for some reasonable period of time
to allow the slaves to sync.

In other words, something like this:

1) Pass in an id (via ACCEPT_CONTEXT in Catalyst where the id is stored in
the session, say).
2) For any operation that goes to the master (e.g. transaction or write) set
a flag in a cache (in memcached).  This flag will be used by subsequent
request to read from the master.

Likewise, upon fetching a schema object check for the flag (in the cache)
and if set then call set_reliable_storage().  Sure, the flag could be in the
session, but the scope may need to be wider than a session at times.

Anyone extended this class to do something like this already?    If not, can
someone familiar with the module provide some tips on how to accomplish?

Thanks,



-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20100103/5fb=
c8513/attachment.htm


More information about the DBIx-Class mailing list