From: Eduardo Jezierski
Date: Fri, 12 Dec 2008 14:33:44 -0800
To: Daniel Myung
Cc: Daniel Cazzulino , Juan Tondato , Jonathan Jackson Cory Zue
Conversation: mesh4x and python/django?
Subject: Re: mesh4x and python/django?
Daniel,
When is your trial in Zambia starting? Can you tell us more about
what you are trying to achieve (eg user X takes picture and puts in
folder, then updates database, then.... Etc)
More info-
Re: server
– Jonathan asked for more info... so here is more info...
http://edjez.instedd.org/2008/12/for-geeks-progress-on-mesh4x-cloud.html
The store is a Mesh4x adapter for S3 (or Mysql over block storage)
Question to help steer our efforts: If you were to use this, what
reuse mechanism do you see for the service? (we were thinking A and D
to be the most common, but would love your input.
A) do you see yourselves using a
sync.instedd.org instance (with
security scoped by the app)
B) Should we prep the VM image ‘nicely’ and share it on EC2 so you can
start your own?
C) Should we prep another VM you can download and run in some box you
own?
D) We prep the code and services to be deployed in your own native or
virtual instances on apache
Re: mesh4x
– mesh4x right now evolved around synchronizing data, not just files.
We haven’t run into a scenario where people wanted to synchronize
files per se, but an adapter wouldn’t be hard. Depending on the sizes
of the files,
Hm...your questions tell me we need a much better intro set of docs to
mesh4x and what it does today and where its going
Imagine this scenario:
2+ databases (of any kind, CSV to mysql to access to a KML file or a
javarosa/rms store)
Updates are happing on the same entities one either side
‘ the same entities’ means we are partly updating the same
information – eg I update a patient location, you update their
symptoms, and some apps mught just ‘get’ part of the info
You want to share those updates and get the updates of others (and in
updates I include insertions, edits, deletions, etc)
RDF is just the ‘ default’ data format for things that look like
dictionaries (just like you use xforms)
But the mesh4x libraries just move anything opaquely (e.g. We read a
KML file and decompose it into its versionable entities – pushpins,
placemarks, polygons, styles, hierarchies, track versions for those,
and then re-compose the KML on the other end). Or you could exhange
xforms as-is.
re: file sharing
What you sugest will move your files around, making sure the latest
updated is spread around. Unless each entity is in a different file
you might loose updates (and then it’s a latest-one-wins scenario per
file, I believe, for bosh WLM and Dropbox); and it seems like a
straightforward approach if concurrent updates, and manual conflict
resolution is not needed. (eg moving pictures around, they tend to be
never edited and then its unlikely 2 folks will edit the same thing at
concurrently).
I’d consider groove for your tests: In past excercises we moved
pictures around using groove shared folders (great for lower bandwidth
as it chunks the data exhanges and survives interruption – we even did
it over BGAN satellite links; and I know Robert deployed a
telemedicine solution based on moving microscopy JPEGs around in
groove), and they have the discovery, security, etc built in; and no
internet connection needed not even for rendezvous or update pings.
(not sure how dropbox or wlm work in these scenarios)
Not sure about how WLM would behave in this connectivity context but I
would definitely test it. I know the chaps doing the sync fx and no
matter how much I tried to hammer humanitarian scenarios to their
cortex 1+ years ago, it’s a tough sell when they are trying to ship.

From: Daniel Myung
Date: Fri, 12 Dec 2008 15:53:27 -0500
To: Eduardo Jezierski
Cc: Daniel Cazzulino Juan Tondato , Jonathan Jackson Cory Zue
Subject: Re: mesh4x and python/django?
Hey Eduardo, and other Meshers,
Our timeline is a bit tight, as we'd like to have some semblance of a
trial in Zambia sometime soon. I don't think we have the time or
resources to look into contributing a python/django adapter
implementation just yet. But it's something that intrigues me as well
Thinking through it some more, I think the file synchronization for
p2p is the compelling story we want to focus on. To reiterate, if 2
laptops are using Dropbox or Microsoft Mesh, there's essentially an
always updating directory on their system that reflects the contents
of their peer's laptop, provided there's enough connectivity to
attempt a synchronization. I'm thinking by putting as much faith into
the file transfer properties (this includes the feed xml + the binary
images), we can have our sync framework just use this one transaction
method. For our scenario dropbox/mesh address the discovery and peer
to peer connectivity of multiple remote hosts as well as one time cost
of moving binary data to remote peers.
The host can act as a hub, starting up a dropbox/mesh account and then
divvy out unique shared folders to remote accounts they want to
receive syncs from.
Re: cloud services? What's the underlying storage mechanism for
that? Is it an API dressing for the storage methods like Skydrive or
S3 or something?
In summary, I guess we could use a primer on the pros and cons of your
file based synchronization method. Is it just pure RDF based feeds
that just updates for both the left side and right side to ensure that
they are both equal at the end of the transaction? How does this
differ from the KML example?
I've cc'ed another Dimagi'er, Cory on the conversation as he's part of
our collective effort to building up this component.
Thanks,
Dan
On Wed, Dec 10, 2008 at 5:37 PM, Eduardo Jezierski <
ed...@instedd.org>
wrote:
Daniel,
There's two approaches – using Django's ORM layer (requiring
Python implementation) or writing directly to MySQL / SqlLite from a
Java app using Hibernate.
The mesh scenario you describe is precisely one we want to
support. We are abut to finish a short project with CDC to sync
EpiInfo via cloud or SMS and then transform/map the cloud info
automatically onto maps/kml.
A Python implementation of the core libraries would be IMO something
widely useful and easier to build than may seem, but may be out of
scope for an initial proof of concept. But if you want to get a deep
understanding of all this or want to have some OSS fun these holiday,
you an take the Java libraries, port the unit tests to Py first, and
then work out the rest.
Sounds like you'll want HTTP to the cloud store, and then some peer to
peer exchange between laptops. There are adapters to files that you an
sync from and to, so no problem there. Tthe next question is how to
make 2 machines on the same net automagically discover each others
services and do the syncing once they rendezvus.
For the peer to peer rendezvous we don't have any implementations
yet; we did some playing around with WASTE networks (interesting,
cumbersome) and haven't yet done any work with Zeroconf but it looks
promising (there's our holiday hack project). Suggestions welcome.
What timelines are you thinking about?
I am assuming the images for the moment are not being updated, too
(mesh4x would have to bring in something like rsync to sync enclosures
efficiently without moving huge chunks of bin around, and weve been
focusing on the whole forms / javarosa/ structured data sync ; and
getting the cloud service up this week)
Cheers. Adding Jonathan so hes in the loop too.
Will send you a link to the dev instance of the cloud service when its
up later this week
ej

From: Daniel Myung
Date: Wed, 10 Dec 2008 10:16:17 -0500
To: Daniel Cazzulino
Cc: Eduardo Jezierski , Juan Tondato
Subject: Re: mesh4x and python/django?
Thanks for the reply!
Django has an ORM layer built with python. It has hooks to most of
the major dbs (ms sql needs some finesse), most people use sqlite or
mysql as default. It's just a single line change in the config to
switch from one db to another.
http://docs.djangoproject.com/en/dev/topics/db/models/
http://docs.djangoproject.com/en/dev/topics/db/queries/
I'm guessing that we should probably use Java for the sake of
generality (as we foresee some of our installs being put on linux
VMs). I just wasn't sure whether or not there was a way forward for
using pure python to reduce the number of moving parts to install. I
suppose in the interest of time/proof of concept, I could just bypass
the django API and have hibernate plug into the DB directly.
To clarify the situation some more, we're looking to use something
like microsoft Mesh or Dropbox as the actual transport of
information. We like these because they are opportunistic in their
attempt to connect and sync the big chunks of data.
We're building our case upon a local laptop will do its sync with
whatever the storage service gets from the cloud storage. So, in
essence, it's a glorified USB key transfer. So actually i misspoke,
HTTP might not be necessary.
my local data dir\updates.db (published in whatever say), + images
laptop_images = [x,y,z]
my microsoft mesh or dropbox share\tosync.db
remote_images = [x, w]
if updates.db != tosync.db
synchronize
iflaptop_images != remote_images
synchronize => [w,x,y,z]
where the dbs have pointers to images as part of each record.
Hope this clears things up,
Dan
On Wed, Dec 10, 2008 at 9:55 AM, Daniel Cazzulino
<
dan...@cazzulino.com <
http://dan...@cazzulino.com> > wrote:
Hi Daniel,
sounds like a very good fit for mesh4x indeed!
Which platform are you looking to create the adapter in? Java, .NET?
I'm not familiar with Django, which DB do they use?
If you go with Java, you can use the Hibernate adapter we have, to
communicate with the DB on one end, and the HTTP adapter to sync to
the cloud.
From there, you can have another client do the opposite, sync'ing from
the cloud via the HTTP adapter to a local DB via the Hibernate
adapter.
So the flow would be:
Local DB (via Hibernate adapter) <-> Cloud opaque storage (via HTTP
adapter) <-> Another local DB (via Hibernate adapter)
(that would be for peer-to-peer sync)
and
Local DB (via Hibernate adapter) <-> Cloud opaque storage (via HTTP
adapter) <-> Django site DB (via Hibernate adapter)
I'm looping Ed and Tondat in case they want to add more info/comments.
Thanks,
/kzu
On Mon, Dec 8, 2008 at 5:38 PM, Daniel Myung <
dmy...@dimagi.com
<
http://dmy...@dimagi.com> > wrote:
Hi Daniel,
We briefly spoke on the mesh4x democall a few weeks back. I thought
I'd send another ping to follow up with some additional questions.
We here at Dimagi are looking to explore continuing uses of Mesh4x for
a variety of uses for offline capable synchronization. In particular
we're looking to build up a telemedicine consultation/collaboration
site that synchronizes images and structured data. The data is being
stored and managed via a Django site and DB. We were wondering if you
had any suggestions on how to tackle the creation of an adapter to
handle the synchronization of this data.
The particulars are deliberately simplified to address an initial
prototype. Basically each side is only able to generate new data. A
nurse on one end can create patients, consultrequests, photos and
comments (to photos). A doctor on the other can only create
consultresponses (linked to a consultrequest) and comments on photos.
The HTTP adapter seems to fit the bill on this...but we were wondering
if you had any other suggestions and/or requests to fill out your
needs to create additional adapters and use cases.
Any assistance would be appreciated,
Dan