Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 66783 invoked from network); 12 Mar 2011 15:32:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Mar 2011 15:32:53 -0000 Received: (qmail 41278 invoked by uid 500); 12 Mar 2011 15:32:52 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 41226 invoked by uid 500); 12 Mar 2011 15:32:51 -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 41218 invoked by uid 99); 12 Mar 2011 15:32:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Mar 2011 15:32:51 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ryan.ramage@gmail.com designates 74.125.82.54 as permitted sender) Received: from [74.125.82.54] (HELO mail-ww0-f54.google.com) (74.125.82.54) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Mar 2011 15:32:45 +0000 Received: by wwd20 with SMTP id 20so3939594wwd.23 for ; Sat, 12 Mar 2011 07:32:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=rCUh4EJgkY/4WczjbTdY2rmz5p4kJgFT+s9mCjgPJ3E=; b=DEK4nOEck2sEsGUdkOiW83Peme1fFqBnNdTN07SPwnruY/oYtEzQRQk42pVlJ4A/xZ l5cd11ICL3eVtjxVMDw9Tl2wMtLcZ08RyySjVpshqsIYzCzG/lkw6ixzheSRyvEn4Brz /0DQUpjkSOPkSdN1O8itP6TDb4CYytePY9y3s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=AztsYRcHuOqnlvXVhSPGQ3SUwFgP427+d4+xidS4e7AoP7EF4BR2HLZ3/UIq9D+Gvn YPzWbI+JvSnlWy8XOaPLAi46fweCJBZ8eH0KNfgpWfQizDGnEE6Ee7t2YC67B3tt0MW0 VNvA4lk3m9dy5arxLzsrp1PSYZo4XNMVzr+h4= MIME-Version: 1.0 Received: by 10.227.160.11 with SMTP id l11mr9359328wbx.1.1299943944939; Sat, 12 Mar 2011 07:32:24 -0800 (PST) Received: by 10.227.156.141 with HTTP; Sat, 12 Mar 2011 07:32:24 -0800 (PST) In-Reply-To: References: Date: Sat, 12 Mar 2011 08:32:24 -0700 Message-ID: Subject: Re: Online-Offline URL strategy From: Ryan Ramage To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Thanks for the ideas! Although they would work, I am not sure that editing a users hosts file is a good practice or asking them to change their dns to use an installed dns on their machine. In my app, the url the user interacts with *are* html pages, at least for now, so I think I might switch my approach and use the offline html5 spec. I will cache the css and html and based on if they are online or not, I will use jquery couch lib to either connect to a local or remote couch. The local couch will have to have jsonp on. On Fri, Mar 11, 2011 at 3:22 PM, Nitin Borwankar w= rote: > You may need to run a skeleton DNS server on localhost which understands = your address allocations. > > Nitin > > Sent from my mobile Internet device > > > On Mar 11, 2011, at 2:10 PM, Joe Freeman wrote: > >> How about you just always send the user to the local instance if they >> have couch installed by putting '127.0.0.1 app.com' in /etc/hosts (or >> similar). Then you don't have to worry about the 'remote'/'local' >> subdomain. Anyone that doesn't have couch installed (and hence doesn't >> have the customised /etc/hosts) will get directed to the remote >> instance. >> >> The only problem is that users with couch installed locally won't be >> able to access the remote couch directly (on the 'app.com' domain), >> but if you can rely on couch syncing the databases, is this even a >> problem? >> >> (Obviously you can't setup the replication using the 'app.com' domain, >> as the local instance would end up syncing with itself?) >> >> Does that help? >> >> >> On 10 March 2011 19:16, Ryan Ramage wrote: >>> Ok, this maybe slightly off-topic for couch, but since it is the >>> garden path couch has led me down for the design of my app, I am sure >>> others here will have an opinion. >>> >>> >>> Here is what I have: >>> On a users machine, they have a local couch instance. It syncs up with >>> a hosted couch. Here are some 'example urls' >>> >>> http://local.app.com/db/doc >>> http://remote.app.com/db/doc >>> >>> (I have an A record dns entry =A0local.app.com -> localhost) >>> >>> Here is what I want: >>> I want URLs that will failover to either the local or remote depending >>> on what is available. >>> >>> >>> >>> Situation 1. >>> So lets say I am ROAMING with no inet connection. I open a =A0word >>> document on my local machine, which contains the link: >>> >>> http://remote.app.com/db/doc >>> >>> When I click on the link, would there be a way that it get redirected >>> to http://local.app.com/db/doc >>> >>> >>> >>> >>> Situation 2. >>> Someone has emailed me a word doc, and I have no couch locally. I open >>> a url in the doc: >>> >>> =A0http://local.app.com/db/doc >>> >>> Since I have no couch locally, could they be redirected to >>> http://remote.app.com/db/doc >>> >>> >>> >>> Situation 3 >>> So lets say I am ROAMING, BUT HAVE inet connection. I open a =A0word >>> document on my local machine, which contains the link: >>> >>> http://remote.app.com/db/doc >>> >>> When I click on the link, would there be a way that it get redirected >>> to http://local.app.com/db/doc >>> This way the fastest copy will be used. >>> >>> >>> My Initial idea (untested) >>> I was thinking about having the following DNS entries: >>> >>> local.app.com =A0 IN =A0 =A0 =A0A =A0 =A0 =A0 localhost =A0 =A0 =A0 =A0= =A0 =A0300s =A0 =A0 =A0 (5m) >>> local.app.com =A0 IN =A0 =A0 =A0A =A0 =A0 =A0 74.74.74.74 =A0 =A0300s = =A0 =A0 (5m) >>> remote.app.com IN =A0 =A0 =A0 A =A0 =A0 =A0 74.74.74.74 =A0 =A0300s =A0= =A0 (5m) >>> remote.app.com IN =A0 =A0 =A0 A =A0 =A0 =A0 localhost =A0 =A0 =A0 =A0 = =A0 =A0300s =A0 =A0 =A0 (5m) >>> >>> >>> Would that even work? I am not sure how a browser (or other client) >>> takes the order or A records. Also, when offline, and no real dns is >>> available, would there be a cached copy so at least >>> it would resolve to localhost? >>> >>> So the discussion is about keeping, nice, world friendly URLs that >>> might please Tim Berners-Lee, and also having the local/remote copies. >>> >>> Any thoughts? >>> Ryan >>> >