incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Ramage <ryan.ram...@gmail.com>
Subject Online-Offline URL strategy
Date Thu, 10 Mar 2011 19:16:25 GMT
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  local.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  word
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:

 http://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  word
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	IN	A	localhost  	     300s	(5m)
local.app.com	IN	A	74.74.74.74    300s	(5m)
remote.app.com IN	A	74.74.74.74    300s	(5m)
remote.app.com IN	A	localhost  	     300s	(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

Mime
View raw message