Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C13B110788 for ; Tue, 4 Feb 2014 18:29:00 +0000 (UTC) Received: (qmail 90826 invoked by uid 500); 4 Feb 2014 18:28:59 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 90712 invoked by uid 500); 4 Feb 2014 18:28:58 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 90704 invoked by uid 99); 4 Feb 2014 18:28:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Feb 2014 18:28:58 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dch@jsonified.com designates 74.125.83.50 as permitted sender) Received: from [74.125.83.50] (HELO mail-ee0-f50.google.com) (74.125.83.50) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Feb 2014 18:28:54 +0000 Received: by mail-ee0-f50.google.com with SMTP id d17so4443121eek.23 for ; Tue, 04 Feb 2014 10:28:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jsonified.com; s=google; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:content-transfer-encoding:content-disposition; bh=3c/gs1eknrXjlZMhgdAaikMd+drWR4xLWSz8xLeml4Q=; b=KRDdQlBLggRJZx59A4AOGZ3TYdNmjx115svrhJYpMC77NQaSd2Yr9zmJ//plzF29/h JxH+sMFcHUgYGn4hpA2BRIiMsU5mqS3F5NsJ32qawP4LXbAXo+qq6Jjn/OADVkp1mdbY vST2DhQa5dcZG1w1JRtE4D0XudqCgyLY5X10c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:message-id:in-reply-to:references :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=3c/gs1eknrXjlZMhgdAaikMd+drWR4xLWSz8xLeml4Q=; b=QsfwXR3+C9y9d3ALTtZCwAJHsoTZL+Y+jH+jbHVWJzib70Vc40utFgUnn/eC561ASn 5OY9loRV6AZ0BXwICxQRh4Hb9HmTahZhGvyd4Aqsjo6CM2fPEfcM09Pn1okuwvDPBGIf uukHM7QZ+WDXivKzyrZA8x8ALCXuWg/L+WnoUrNbJNlnDYDdAi3pTgtXpEbdQARRspxC gqjPxMRMaDhbai2RdqqEJtRqzdveoRZqLWwojWFVYuiFmfR4Y1NF9xFh5mYkBllCtZ/l 5+QGp1Z5mhAK0y1wgKQdie7dhg/11fxNLbm0QQjPo1zsbUMc++6srfKW0aXmlz/zV+xs /neQ== X-Gm-Message-State: ALoCoQnsoHnchYyek35mAURJ5Tdu0tqjft3MCzOGSLiLWGHGRBZv/AEveqkvIqcTA5pN8Ix4Byp4 X-Received: by 10.14.89.66 with SMTP id b42mr23736eef.115.1391538512423; Tue, 04 Feb 2014 10:28:32 -0800 (PST) Received: from akai.jsonified.com (chello084112019176.2.11.vie.surfer.at. [84.112.19.176]) by mx.google.com with ESMTPSA id g1sm91605728eet.6.2014.02.04.10.28.31 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 10:28:31 -0800 (PST) Date: Tue, 4 Feb 2014 19:28:27 +0100 From: Dave Cottlehuber To: user@couchdb.apache.org Message-ID: In-Reply-To: References: Subject: Re: Replication without IP connection X-Mailer: Airmail Beta (228) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org On 29. J=C3=A4nner 2014 at 16:21:37, Brad Rhoads (bdrhoa=40gmail.com) wro= te: > =46rom: Brad Rhoads To: user=40couchdb.apache.org Subject: Replication = =20 > without IP connection Date: 29. J=C3=A4nner 2014 16:21:04 MEZ Our Estan= te app (http://www.maf.org/estante) =20 > is has similar requirements. Except right now we only do peer to peer. = Can you schedule =20 > a time for remote users to get together every so often=3F Or can you ge= t a dedicated person =20 > to visit the remote sights=3F You might check out Open Data Kit. It won= 't help with what you =20 > already built, but it might work over hf. Another solution could be to = use voice to call =20 > in results, if you have a signal. Maybe the easiest thing would be to h= ave your app generate =20 > emails to the central location. We developed email over HR years ago. =46= eel free to contact =20 > me off list. On Jan 27, 2014 9:30 AM, =22Aaron Huslage=22 wrote: > Hi, = =20 > > > I have a strange problem that I'm hoping someone either has dealt w= ith or > has ideas =20 > about solving. > > We have developed a medical records system as a Couc= hApp that allows =20 > > clinicians in remote areas to submit medical records to a local serve= r. > These records =20 > need to be replicated back to a central office for reporting > purposes= . > > These remote =20 > clinics are completely disconnected from the Internet and > connect to = one another over =20 > H=46 Radio (think ham radio back in the day). The > radio links are not= really reliable or =20 > quick enough for PPP to work well, > so we are using UUCP instead of IP= . > > In this scenario, =20 > there is no interactive communication between nodes. > Everything is ba= tch file copies. =20 > I need a way to do a CouchDB replication > using only file transfers an= d cron/inotify jobs. =20 > > > Any ideas or scripts would be helpful. > > Thanks, > Aaron > > -- >= Aaron Huslage > +1-919-600-1712 =20 > > IM: GTalk - huslage=40gmail.com; Skype - huslage > > PGP: 0x360DE590 = / 30D4 B15B 74B2 =460E9 =20 > 35D4 ABE0 2CB7 AC60 360D E590 > Three things came to mind which are worth mentioning; 1. HTTP and JSON are almost certainly not the best protocol & wire format= , considering your bandwidth (and presumably =C2=A0power) constraints. Consider using msgpack=5B1=5D, google protocol buffers =5B2=5D, capnproto= =5B3=5D, piqi=5B4=5D anything with a smaller on-the-wire format, that id= eally takes account of the schema you have implicitly in your data. =5B5=5D= might be interesting too, wrt MQTT-S as an alternative lightweight trans= port too. I=E2=80=99d consider carefully the robustness of the transport = layer to bit flipping & other errors. 2. I don=E2=80=99t see replication as inherently requiring a synchronous = question/answer session where both parties need to be online, it=E2=80=99= s this way in CouchDB because it is a bit more efficient. Consider rollin= g your own implementation that speaks JSON locally but creates a pack fil= e using your optimised on-the-wire format. Some implementations I=E2=80=99= m aware of at =5B6=5D, while these are all old, they are also simple. The= re=E2=80=99s no doubt a great one tucked inside pouchdb, and presumably i= n the couchbase sync libraries too for reference. =46inding those is an e= xcercise to the reader. If you need to write a replication & wire format for your app from scratc= h, you might consider reading about CRDTs (commutative replicated datatyp= es) which offer a robust theoretic basis for merging and ordering data as= ynchronously. I believe the next version of Riak has support for these. 3. This sure sounds like a solved sort of problem in the HAM radio world.= You might find an existing solution with a little pollination. But I=E2=80= =99m not sure that CouchDB and RESTish/HTTP behaviour are really the best= fit for your app wrt to how you need replication to work. But it might b= e better than anything else. If you do decide to hack in and around couch= to make all this work, I=E2=80=99d love to see a plugin that uses a non-= HTTP transport turn up in the community. =5B1=5D:=C2=A0https://github.com/msgpack/msgpack-erlang =5B2=5D:=C2=A0https://github.com/jeremyong/eprotoc &=C2=A0https://github.= com/basho/erlang=5Fprotobuffs =5B3=5D:=C2=A0http://kentonv.github.io/capnproto/ &=C2=A0https://github.c= om/kaos/ecapnp =5B4=5D: http://piqi.org/ =5B5=5D: http://www.slideshare.net/nivertech/zvi-mqtts-foreuc2013 =5B6=5D:=C2=A0https://github.com/jo/roy-replicator &=C2=A0https://github.= com/mikeal/replicate and=C2=A0https://github.com/maxogden/replicate A+ -- =20 Dave Cottlehuber Sent from my PDP11