[Twisted-Python] pb.Cacheable vs. offline queuing

Jordan Krushen jkrushen at gmail.com
Fri Nov 4 18:46:13 EST 2005

I'm designing a job-tracking/workflow system for a client, with a
primary requirement being the use of a hosted server for
web/RPC/REST/sftp presence (among other things, thanks to Twisted),
and another local server internal to their office, both kept up to
date with each other (each holding a local DB;  I'm undecided on
exactly which one).  Users would use the web UI through the hosted
server, office staff would use a Cocoa client speaking PB to the
office server.  Ignore the workstation-server PB connections for now,
I'm just concerned with the server-server connections.

I've been looking at Cacheable, as the live updates between servers
would be useful, but I have a few questions:

How does it avoid collisions, if an attribute is changed on both ends
at once?  Is any kind of 2PC involved, or similar?  I read that some
part of reading/observing is atomic, but is modifying atomic as well?

If it does deal with simultaneous updates in a robust way, I'm still
dealing with another requirement:  the two servers (public and office)
must both keep serving users, even if the connection between them is
severed.  Changes must accumulate on both ends, and any collisions
would be dealt with manually by the office staff once the connection
came back up.  Total amount of collisions is expected to be somewhat
low due to the nature of their business and its clients.

Would it be possible to use Cacheables, but have them queue their
communications if the remote side goes away?  Should I just
reimplement this as a layer on top to use Cacheables if it's online,
and something custom to do reconciliation when the connection comes
back up, then switch back to Cacheables, or would customizing
Cacheable be the better road to take?

What other ways of syncing systems (with offline queuing) have you guys used?


More information about the Twisted-Python mailing list