> On Sep 12, 2014, at 2:38 AM, Daniel Owen <[email protected]> wrote:
> 
> …still unsure what to recommend to an experienced C# .net / JavaScript web 
> developer who is investigating building a Couchbase Lite app for both mobile 
> and the desktop (ideally web access on the desktop).

The ideal desktop solution (IMHO) would be a native app (Cocoa on OS X, .NET on 
Windows). Have you already ruled that out?

> - same authentication process for both the mobile and desktop/web.

Then you'd probably want to manage auth in the web-app server, and add an API 
endpoint that generates a Sync Gateway session cookie, as described in the 
"custom auth" section of the Gateway docs.

> - contents of the database needs to be kept in sync.  i.e. updates by a user 
> on the desktop/web app need to be picked-up by the mobile app.

We're still working out the best practices for this, and developing extra 
functionality for the Gateway to make it easier in future versions. There are 
two approaches you can use, based on whether you want your app server to talk 
to Sync Gateway or directly to the Couchbase Server.

(1) App server talks to Sync Gateway using its REST API. You can use any 
CouchDB adapter library if you don't want to code the REST calls yourself (e.g. 
Ektorp for Java; there's one for nearly any language you like.) The major 
gotcha right now is that Gateway 1.0.2 doesn't have its own API for creating or 
querying views. The workaround is to use the Couchbase Server API (which is 
nearly identical) for that.

(2) App server talks to Couchbase Server directly. You'll need to set up 
bucket-shadowing: you'll have a master bucket that your app server interacts 
with, and the Gateway will create and manage its own 'shadow' of that for its 
own use. You can use any Couchbase SDK to talk to the server.

Option 1 is lighter weight because you don't need to create a copy of your 
bucket. It also gives you better control over conflicts since you're talking to 
an API that understands revisions/conflicts/resolution.

Option 2 is probably a bit more stable because you're going through the 
well-established Couchbase Server API, i.e. you're using a version 2.5 or 3.0 
product instead of 1.0 :)

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/756807D7-70D8-4858-86BC-65A60F020E74%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to