Connecting Couchbase sync adapter to couchdb server

走远了吗. 提交于 2019-12-10 18:04:58

问题


How do I connect the couchbase sync adapter to a couchdb server, the docs only say how to use couchbase server and then to use the "administrator console" which couchdb doesn't have, and when I run

sync_adapter -url 192.168.1.xx/mydb 

it returns an error

Before you say "it can't be done", here is a quote from the couchbase docs

"Couchbase Lite can sync with servers running Apache CouchDB and with Couchbase Server via Sync Gateway."


回答1:


Couchbase Lite is compatible with CouchDB replication, and you can use it same way as you would use Sync Gateway on top of Couchbase.

What you mixed here is 3 different tools:

  1. Sync Gateway, which is actually adapter between Couchbase Server and CouchDB API
  2. CouchDB which is another database
  3. Couchbase Lite which is mobile database solution

To be more clear, Couchbase Lite is document storage database for mobile platform and from API it totally looks like CouchDB. Since CouchDB has nice and pretty replication algorithm that works over HTTP API (ye, you only need internet connection to make synchronization), authors of Couchbase Lite found it handy and used it. Next, since Couchbase database uses binary protocol for (instead of HTTP replication) synchronization, they made Sync Gateway for that "HTTP API" sync.

I am not sure if you can replicate Sync Gateway (backed by Walrus or Couchbase) with CouchDB, but for sure you can replicate your Couchbase Lite with Sync Gateway AND/OR with CouchDB.

So long story short:

  • CouchDB = database with HTTP API for all operations,
  • Couchbase = database, binary protocol (=you need drivers for it),
  • Sync Gateway = HTTP API on top Couchbase
  • or you can say - Couchbase + Sync Gateway = CouchDB, and
  • Couchbase Lite = CouchDB for mobile



回答2:


I don't think you can - note that Couchbase Server is a significant evolution / fork of CouchDB, and as such the two now differ significantly.

Would it be possible to change CouchDB to be able to connect to Couchbase Sync Gateway? Possibly, but AFAIK no-one has done that yet.




回答3:


Synchronization/Replication is inherent in CouchDB. It has it's own replication protocol. (http://docs.couchdb.org/en/latest/intro/overview.html?highlight=replication)

Depending on your application/goal you can sync/replicate directly to CouchDB without using the couchbase sync adapter.

Couchbase lite (both IOS and Android versions) can sync/replicate directly to Couchdb. Two CouchDB instances can sync/replicate directly to each other. Pouchdb can sync/replicate directly to other Pouchdb instances or to Couchdb.

You only need the couchbase sync adapter to get couchbase to sync/replicate.




回答4:


sync_gateway -bucket mydb -url http://name:pass@localhost:8092



来源:https://stackoverflow.com/questions/23792312/connecting-couchbase-sync-adapter-to-couchdb-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!